[ovs-dev] [PATCH v2] datapath-windows: Fix potential deadlock in event subscription

Sairam Venugopal vsairam at vmware.com
Wed Feb 27 00:45:10 UTC 2019


Move the EventQueue lock acquisition after the dispatchLock to prevent a
potential deadlock in port creation pipeline. There could be a case where
a port event could try to take up the Dispatch Lock before the Event Queue
lock and the subscription queue event could take up the event queue lock
before the dispatch lock.

Found while testing with Driver Verifier enabled.

Signed-off-by: Sairam Venugopal <vsairam at vmware.com>
---
 datapath-windows/ovsext/Event.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/datapath-windows/ovsext/Event.c b/datapath-windows/ovsext/Event.c
index 348f032..69cdb43 100644
--- a/datapath-windows/ovsext/Event.c
+++ b/datapath-windows/ovsext/Event.c
@@ -245,9 +245,8 @@ OvsSubscribeEventIoctl(PFILE_OBJECT fileObject,
         return STATUS_INVALID_PARAMETER;
     }
 
-    OvsAcquireEventQueueLock(eventId);
-
     instance = OvsGetOpenInstance(fileObject, request->dpNo);
+    OvsAcquireEventQueueLock(eventId);
 
     if (instance == NULL) {
         status = STATUS_INVALID_PARAMETER;
-- 
2.9.0.windows.1



More information about the dev mailing list