[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH] Ensure session stays locked until the reference to WatchThread is stored in it.



From: Ben Chalmers <Ben.Chalmers@xxxxxxxxxx>

This prevents us trying to dispose of an uniintialised WatchThread
if a session is removed (by the driver being removed) while the
session is still being created

Signed-off-by:  Ben Chalmers <ben.chalmers@xxxxxxxxxx>
---
 src/xeniface/wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xeniface/wmi.c b/src/xeniface/wmi.c
index 8777e25..a8ebfdf 100644
--- a/src/xeniface/wmi.c
+++ b/src/xeniface/wmi.c
@@ -1160,7 +1160,6 @@ CreateNewSession(XENIFACE_FDO *fdoData,
         session->suspended=TRUE;
     }
     fdoData->Sessions++;
-    UnlockSessions(fdoData);
     InitializeObjectAttributes(&oa, NULL, OBJ_KERNEL_HANDLE, NULL, NULL);
 
     status = PsCreateSystemThread(&hthread, THREAD_ALL_ACCESS, &oa, NULL, 
NULL, WatchCallbackThread, session);
@@ -1170,6 +1169,7 @@ CreateNewSession(XENIFACE_FDO *fdoData,
             return status;
     }
     ObReferenceObjectByHandle(hthread, THREAD_ALL_ACCESS, NULL, KernelMode,  
&session->WatchThread, NULL);
+    UnlockSessions(fdoData);
     RtlFreeAnsiString(&ansi);
     return STATUS_SUCCESS;
 }
-- 
2.7.0.windows.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.