summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Util.h
diff options
context:
space:
mode:
authorAlin Serdean <aserdean@cloudbasesolutions.com>2017-11-06 17:33:33 +0200
committerAlin Gabriel Serdean <aserdean@ovn.org>2017-11-29 16:51:08 +0200
commitcba5d1489bf89ff81472986b18b9b13c5b5f8748 (patch)
tree477eb1bed705fa20b7017692803515b25499f5ea /datapath-windows/ovsext/Util.h
parentc8025aee4fa6a862d142dd8da780d45aaf0a868c (diff)
downloadopenvswitch-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.h15
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_ */