From b8b81ddc43ade00c25b4636cbcdf18f7d906b34a Mon Sep 17 00:00:00 2001 From: Sairam Venugopal Date: Tue, 26 Feb 2019 16:45:10 -0800 Subject: [PATCH] datapath-windows: Fix potential deadlock in event subscription 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 Acked-by: Alin Gabriel Serdean Signed-off-by: Alin Gabriel Serdean --- 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 348f03222..69cdb431b 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.39.5