[NTOSKRNL] Only consider SharedCacheMap value once ViewLock is acquired.
authorPierre Schweitzer <pierre@reactos.org>
Wed, 23 May 2018 06:37:50 +0000 (08:37 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Wed, 23 May 2018 06:41:46 +0000 (08:41 +0200)
commit8a8cb4d8907c698b70b0cb5688bea805f68537b8
tree6a50a620adb084aabce271dc06d46dd6e9298539
parent39281f0f7061f425c13209b382830837d31dadfc
[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
ntoskrnl/cc/view.c