- Don't leak a handle if user mode tries to debug the system process

svn path=/trunk/; revision=36230
This commit is contained in:
Stefan Ginsberg
2008-09-14 11:27:28 +00:00
parent cbfff94876
commit 896fd757c7
+6 -1
View File
@@ -1643,7 +1643,12 @@ NtDebugActiveProcess(IN HANDLE ProcessHandle,
if (!NT_SUCCESS(Status)) return Status;
/* Don't allow debugging the initial system process */
if (Process == PsInitialSystemProcess) return STATUS_ACCESS_DENIED;
if (Process == PsInitialSystemProcess)
{
/* Dereference and fail */
ObDereferenceObject(Process);
return STATUS_ACCESS_DENIED;
}
/* Reference the debug object */
Status = ObReferenceObjectByHandle(DebugHandle,