[NTOS:CC] Access SectionObjectPointers without lock in CcRosInitializeFileCache.... 596/head
authorThomas Faber <thomas.faber@reactos.org>
Mon, 4 Jun 2018 12:36:07 +0000 (14:36 +0200)
committerThomas Faber <thomas.faber@reactos.org>
Tue, 5 Jun 2018 14:24:13 +0000 (16:24 +0200)
commit1d398057a3394298d2b251862f383d6eb27142f1
tree0f05b2cecaf5e95bc9ed296c9276710a57051236
parent2355838fbb91c3b857025af3af55c77151347c26
[NTOS:CC] Access SectionObjectPointers without lock in CcRosInitializeFileCache. CORE-14691

kmtest:NtCreateSection calls CcInitializeCacheMap with a
NULL value for SectionObjectPointers. This will cause an exception when
trying to access it, which in Windows can be handled gracefully.
However accessing it while holding ViewLock means the lock will not be
released, leading to an APC_INDEX_MISMATCH bugcheck.

This solves the problem by allocating SharedCacheMap outside the lock,
then freeing it again under lock if another thread has updated SharedCacheMap
in the mean time. This is also What Windows Does(TM).
ntoskrnl/cc/view.c