Author: tfaber
Date: Sat Oct 1 09:03:47 2016
New Revision: 72873
URL:
http://svn.reactos.org/svn/reactos?rev=72873&view=rev
Log:
[NTOS:EX]
- Acquire ProcessLock before accessing a process's thread list in
NtQuerySystemInformation/SystemProcessInformation. Patch by Volodymyr Shcherbyna.
CORE-12001 #resolve
Modified:
trunk/reactos/ntoskrnl/ex/sysinfo.c
Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Sat Oct 1 09:03:47 2016
@@ -812,6 +812,10 @@
{
SpiCurrent = (PSYSTEM_PROCESS_INFORMATION) Current;
+ /* Lock the Process */
+ KeEnterCriticalRegion();
+ ExAcquirePushLockShared(&Process->ProcessLock);
+
if ((Process->ProcessExiting) &&
(Process->Pcb.Header.SignalState) &&
!(Process->ActiveThreads) &&
@@ -821,6 +825,10 @@
Process, Process->ImageFileName,
Process->UniqueProcessId);
CurrentSize = 0;
ImageNameMaximumLength = 0;
+
+ /* Unlock the Process */
+ ExReleasePushLockShared(&Process->ProcessLock);
+ KeLeaveCriticalRegion();
goto Skip;
}
@@ -954,6 +962,10 @@
ExFreePoolWithTag(ProcessImageName, TAG_SEPA);
ProcessImageName = NULL;
}
+
+ /* Unlock the Process */
+ ExReleasePushLockShared(&Process->ProcessLock);
+ KeLeaveCriticalRegion();
/* Handle idle process entry */
Skip: