From 132733d4b064191e917ea98ca4bf165f8cca2071 Mon Sep 17 00:00:00 2001 From: Sairam Venugopal Date: Tue, 26 Feb 2019 16:45:10 -0800 Subject: 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(-) (limited to 'datapath-windows') 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; -- cgit v1.2.1