Author: sginsberg
Date: Sun Sep 14 06:27:28 2008
New Revision: 36230
URL:
http://svn.reactos.org/svn/reactos?rev=36230&view=rev
Log:
- Don't leak a handle if user mode tries to debug the system process
Modified:
trunk/reactos/ntoskrnl/dbgk/dbgkobj.c
Modified: trunk/reactos/ntoskrnl/dbgk/dbgkobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/dbgk/dbgkobj.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/dbgk/dbgkobj.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/dbgk/dbgkobj.c [iso-8859-1] Sun Sep 14 06:27:28 2008
@@ -1643,7 +1643,12 @@
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,