diff options
author | Alin Serdean <aserdean@cloudbasesolutions.com> | 2017-11-06 17:33:33 +0200 |
---|---|---|
committer | Alin Gabriel Serdean <aserdean@ovn.org> | 2017-11-29 16:51:08 +0200 |
commit | cba5d1489bf89ff81472986b18b9b13c5b5f8748 (patch) | |
tree | 477eb1bed705fa20b7017692803515b25499f5ea /datapath-windows/ovsext/Util.h | |
parent | c8025aee4fa6a862d142dd8da780d45aaf0a868c (diff) | |
download | openvswitch-cba5d1489bf89ff81472986b18b9b13c5b5f8748.tar.gz |
datapath-windows: Use only non executable memory
Use only non-executable memory when using MmGetSystemAddressForMdlSafe.
Introduce a new function called OvsGetMdlWithLowPriority for readability.
Found using WDK 10 static code analysis.
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Shashank Ram <shashank08@gmail.com>
Diffstat (limited to 'datapath-windows/ovsext/Util.h')
-rw-r--r-- | datapath-windows/ovsext/Util.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/datapath-windows/ovsext/Util.h b/datapath-windows/ovsext/Util.h index f73c71f63..6f02147b6 100644 --- a/datapath-windows/ovsext/Util.h +++ b/datapath-windows/ovsext/Util.h @@ -152,4 +152,19 @@ UINT32 Rand() return seed.LowPart *= 0x8088405 + 1; } +/* + *---------------------------------------------------------------------------- + * OvsGetMdlWithLowPriority -- + * Return the nonpaged system-space virtual address for the given MDL + * `curMdl` using low page priority and no executable memory. + *---------------------------------------------------------------------------- + */ + +static __inline +PVOID OvsGetMdlWithLowPriority(PMDL curMdl) +{ +return MmGetSystemAddressForMdlSafe(curMdl, + LowPagePriority | MdlMappingNoExecute); +} + #endif /* __UTIL_H_ */ |