[ovs-dev] datapath-windows: Fix static analysis in Stt.c

Message ID 20180208173041.11204-1-aserdean@ovn.org
State Accepted
Headers show
Series
  • [ovs-dev] datapath-windows: Fix static analysis in Stt.c
Related show

Commit Message

Alin Gabriel Serdean Feb. 8, 2018, 5:30 p.m.
The WDK 10 static analysis complains:
stt.c(427): warning C30030: Warning: Allocating executable memory via
specifying a MM_PAGE_PRIORITY type without a bitwise OR with
MdlMappingNoExecute.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
---
 datapath-windows/ovsext/Stt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Sairam Venugopal March 6, 2018, 5:55 p.m. | #1
Didn't realize this patch wasn't acked. Please push this in.

Acked-by: Sairam Venugopal <vsairam@vmware.com>


Thanks,
Sairam

On 2/8/18, 9:31 AM, "ovs-dev-bounces@openvswitch.org on behalf of Alin Gabriel Serdean" <ovs-dev-bounces@openvswitch.org on behalf of aserdean@ovn.org> wrote:

    The WDK 10 static analysis complains:
    stt.c(427): warning C30030: Warning: Allocating executable memory via
    specifying a MM_PAGE_PRIORITY type without a bitwise OR with
    MdlMappingNoExecute.
    
    Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>

    ---
     datapath-windows/ovsext/Stt.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/datapath-windows/ovsext/Stt.c b/datapath-windows/ovsext/Stt.c
    index e3c4b4686..0220a6e80 100644
    --- a/datapath-windows/ovsext/Stt.c
    +++ b/datapath-windows/ovsext/Stt.c
    @@ -424,8 +424,8 @@ OvsValidateTCPChecksum(PNET_BUFFER_LIST curNbl,
         NDIS_STATUS status;
     
         curMdl = NET_BUFFER_CURRENT_MDL(curNb);
    -    buf = (PUINT8)MmGetSystemAddressForMdlSafe(curMdl, LowPagePriority)
    -        + NET_BUFFER_CURRENT_MDL_OFFSET(curNb);
    +    buf = (PUINT8)OvsGetMdlWithLowPriority(curMdl)
    +          + NET_BUFFER_CURRENT_MDL_OFFSET(curNb);
         if (!buf) {
             status = NDIS_STATUS_INVALID_PACKET;
             return status;
    -- 
    2.16.1.windows.1
    
    _______________________________________________
    dev mailing list
    dev@openvswitch.org
    https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=BY4WXq8DeAmm1qlGIU6_uzzNUDAh5i6EKM5G_IdrUVI&s=ioWzOV69cv-8RilP53-ycbEfxEQ70f9WRH4NxzRWErU&e=
Alin Gabriel Serdean March 6, 2018, 6:10 p.m. | #2
Thanks. Applied on master.

Alin.

-----Mesaj original-----
De la: ovs-dev-bounces@openvswitch.org <ovs-dev-bounces@openvswitch.org> În numele Sairam Venugopal
Trimis: Tuesday, March 6, 2018 7:56 PM
Către: Alin Gabriel Serdean <aserdean@ovn.org>; dev@openvswitch.org
Subiect: Re: [ovs-dev] [PATCH] datapath-windows: Fix static analysis in Stt.c

Didn't realize this patch wasn't acked. Please push this in.

Acked-by: Sairam Venugopal <vsairam@vmware.com>

Thanks,
Sairam

On 2/8/18, 9:31 AM, "ovs-dev-bounces@openvswitch.org on behalf of Alin Gabriel Serdean" <ovs-dev-bounces@openvswitch.org on behalf of aserdean@ovn.org> wrote:

    The WDK 10 static analysis complains:
    stt.c(427): warning C30030: Warning: Allocating executable memory via
    specifying a MM_PAGE_PRIORITY type without a bitwise OR with
    MdlMappingNoExecute.
    
    Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>

Patch

diff --git a/datapath-windows/ovsext/Stt.c b/datapath-windows/ovsext/Stt.c
index e3c4b4686..0220a6e80 100644
--- a/datapath-windows/ovsext/Stt.c
+++ b/datapath-windows/ovsext/Stt.c
@@ -424,8 +424,8 @@  OvsValidateTCPChecksum(PNET_BUFFER_LIST curNbl,
     NDIS_STATUS status;
 
     curMdl = NET_BUFFER_CURRENT_MDL(curNb);
-    buf = (PUINT8)MmGetSystemAddressForMdlSafe(curMdl, LowPagePriority)
-        + NET_BUFFER_CURRENT_MDL_OFFSET(curNb);
+    buf = (PUINT8)OvsGetMdlWithLowPriority(curMdl)
+          + NET_BUFFER_CURRENT_MDL_OFFSET(curNb);
     if (!buf) {
         status = NDIS_STATUS_INVALID_PACKET;
         return status;