datapath-windows:Remove user mode instance from pid hash on process termination
authorEitan Eliahu <eliahue@vmware.com>
Sat, 25 Oct 2014 00:46:39 +0000 (17:46 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 28 Oct 2014 14:59:49 +0000 (07:59 -0700)
The instance should be removed from pid-hash when vswitchd.exe terminates so
the driver won't access it during packet miss (causing BSOD)

Signed-off-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows/ovsext/User.c

index 501dc12..fc27f7d 100644 (file)
@@ -98,6 +98,7 @@ OvsCleanupPacketQueue(POVS_OPEN_INSTANCE instance)
     LIST_ENTRY tmp;
     PIRP irp = NULL;
 
+    ASSERT(instance);
     InitializeListHead(&tmp);
     queue = (POVS_USER_PACKET_QUEUE)instance->packetQueue;
     if (queue) {
@@ -139,6 +140,11 @@ OvsCleanupPacketQueue(POVS_OPEN_INSTANCE instance)
     if (queue) {
         OvsFreeMemory(queue);
     }
+
+    /* Remove the instance from pidHashArray */
+    OvsAcquirePidHashLock();
+    OvsDelPidInstance(gOvsSwitchContext, instance->pid);
+    OvsReleasePidHashLock();
 }
 
 NTSTATUS