mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[NTOSKRNL] Only consider SharedCacheMap value once ViewLock is acquired.
This avoids a really nasty race condition in our cache controler where two concurrents could try to initialize cache on the same file. This had two nasty effects: first shared map was purely leaked and erased by the second one. And the private cache map, allocated on the first shared cache map couldn't be freed and was leading to Mm BSOD (free in a middle of a block). This was often triggered while building ReactOS on ReactOS (with multi threads). With that patch, I cannot crash anylonger while building ReactOS. CORE-14634
This commit is contained in:
parent
39281f0f70
commit
8a8cb4d890
1 changed files with 1 additions and 1 deletions
|
@ -1391,12 +1391,12 @@ CcRosInitializeFileCache (
|
|||
BOOLEAN Allocated;
|
||||
PROS_SHARED_CACHE_MAP SharedCacheMap;
|
||||
|
||||
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
|
||||
DPRINT("CcRosInitializeFileCache(FileObject 0x%p, SharedCacheMap 0x%p)\n",
|
||||
FileObject, SharedCacheMap);
|
||||
|
||||
Allocated = FALSE;
|
||||
KeAcquireGuardedMutex(&ViewLock);
|
||||
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
|
||||
if (SharedCacheMap == NULL)
|
||||
{
|
||||
Allocated = TRUE;
|
||||
|
|
Loading…
Reference in a new issue