[NTOSKRNL] Noisily dereference mapped VACB on cache release.

It seems that on process killing, some VACB may be deleted while
still mapped. With current reference counting, they will actually
not be deleted, but leaked, and an ASSERT will be triggered.

CORE-14578
This commit is contained in:
Pierre Schweitzer 2018-04-27 10:23:06 +02:00
parent 708d26acf3
commit fcf83315dc
No known key found for this signature in database
GPG Key ID: 7545556C3D585B0B

View File

@ -1106,6 +1106,12 @@ CcRosDeleteFileCache (
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
DPRINT1("Freeing dirty VACB\n");
}
if (current->MappedCount != 0)
{
current->MappedCount = 0;
NT_VERIFY(CcRosVacbDecRefCount(current) > 0);
DPRINT1("Freeing mapped VACB\n");
}
InsertHeadList(&FreeList, &current->CacheMapVacbListEntry);
KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);