We now always initialize list members from the VACB
and make sure the list entry has properly been removed
from the list before free.
CORE-14349
/* This VACB is in range, so unlink it and mark for free */
ASSERT(Refs == 1 || Vacb->Dirty);
RemoveEntryList(&Vacb->VacbLruListEntry);
/* This VACB is in range, so unlink it and mark for free */
ASSERT(Refs == 1 || Vacb->Dirty);
RemoveEntryList(&Vacb->VacbLruListEntry);
+ InitializeListHead(&Vacb->VacbLruListEntry);
if (Vacb->Dirty)
{
CcRosUnmarkDirtyVacb(Vacb, FALSE);
if (Vacb->Dirty)
{
CcRosUnmarkDirtyVacb(Vacb, FALSE);
Vacb = CONTAINING_RECORD(RemoveHeadList(&FreeList),
ROS_VACB,
CacheMapVacbListEntry);
Vacb = CONTAINING_RECORD(RemoveHeadList(&FreeList),
ROS_VACB,
CacheMapVacbListEntry);
+ InitializeListHead(&Vacb->CacheMapVacbListEntry);
CcRosVacbDecRefCount(Vacb);
CcRosInternalFreeVacb(Vacb);
}
CcRosVacbDecRefCount(Vacb);
CcRosInternalFreeVacb(Vacb);
}
RemoveEntryList(¤t->CacheMapVacbListEntry);
RemoveEntryList(¤t->VacbLruListEntry);
RemoveEntryList(¤t->CacheMapVacbListEntry);
RemoveEntryList(¤t->VacbLruListEntry);
+ InitializeListHead(¤t->VacbLruListEntry);
InsertHeadList(&FreeList, ¤t->CacheMapVacbListEntry);
/* Calculate how many pages we freed for Mm */
InsertHeadList(&FreeList, ¤t->CacheMapVacbListEntry);
/* Calculate how many pages we freed for Mm */
current = CONTAINING_RECORD(current_entry,
ROS_VACB,
CacheMapVacbListEntry);
current = CONTAINING_RECORD(current_entry,
ROS_VACB,
CacheMapVacbListEntry);
+ InitializeListHead(¤t->CacheMapVacbListEntry);
CcRosVacbDecRefCount(current);
CcRosInternalFreeVacb(current);
}
CcRosVacbDecRefCount(current);
CcRosInternalFreeVacb(current);
}
Vacb->Dirty = FALSE;
RemoveEntryList(&Vacb->DirtyVacbListEntry);
Vacb->Dirty = FALSE;
RemoveEntryList(&Vacb->DirtyVacbListEntry);
+ InitializeListHead(&Vacb->DirtyVacbListEntry);
CcTotalDirtyPages -= VACB_MAPPING_GRANULARITY / PAGE_SIZE;
Vacb->SharedCacheMap->DirtyPages -= VACB_MAPPING_GRANULARITY / PAGE_SIZE;
CcRosVacbDecRefCount(Vacb);
CcTotalDirtyPages -= VACB_MAPPING_GRANULARITY / PAGE_SIZE;
Vacb->SharedCacheMap->DirtyPages -= VACB_MAPPING_GRANULARITY / PAGE_SIZE;
CcRosVacbDecRefCount(Vacb);
}
#endif
current->MappedCount = 0;
}
#endif
current->MappedCount = 0;
- current->DirtyVacbListEntry.Flink = NULL;
- current->DirtyVacbListEntry.Blink = NULL;
current->ReferenceCount = 0;
current->PinCount = 0;
KeInitializeMutex(¤t->Mutex, 0);
current->ReferenceCount = 0;
current->PinCount = 0;
KeInitializeMutex(¤t->Mutex, 0);
+ InitializeListHead(¤t->CacheMapVacbListEntry);
+ InitializeListHead(¤t->DirtyVacbListEntry);
+ InitializeListHead(¤t->VacbLruListEntry);
CcRosAcquireVacbLock(current, NULL);
KeAcquireGuardedMutex(&ViewLock);
CcRosAcquireVacbLock(current, NULL);
KeAcquireGuardedMutex(&ViewLock);
ASSERT(Vacb->PinCount == 0);
ASSERT(Vacb->ReferenceCount == 0);
ASSERT(Vacb->PinCount == 0);
ASSERT(Vacb->ReferenceCount == 0);
+ ASSERT(IsListEmpty(&Vacb->CacheMapVacbListEntry));
+ ASSERT(IsListEmpty(&Vacb->DirtyVacbListEntry));
+ ASSERT(IsListEmpty(&Vacb->VacbLruListEntry));
RtlFillMemory(Vacb, sizeof(Vacb), 0xfd);
ExFreeToNPagedLookasideList(&VacbLookasideList, Vacb);
return STATUS_SUCCESS;
RtlFillMemory(Vacb, sizeof(Vacb), 0xfd);
ExFreeToNPagedLookasideList(&VacbLookasideList, Vacb);
return STATUS_SUCCESS;
current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry);
CcRosAcquireVacbLock(current, NULL);
RemoveEntryList(¤t->VacbLruListEntry);
current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry);
CcRosAcquireVacbLock(current, NULL);
RemoveEntryList(¤t->VacbLruListEntry);
+ InitializeListHead(¤t->VacbLruListEntry);
if (current->Dirty)
{
KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);
if (current->Dirty)
{
KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);
{
current_entry = RemoveTailList(&FreeList);
current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry);
{
current_entry = RemoveTailList(&FreeList);
current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry);
+ InitializeListHead(¤t->CacheMapVacbListEntry);
CcRosVacbDecRefCount(current);
CcRosInternalFreeVacb(current);
}
CcRosVacbDecRefCount(current);
CcRosInternalFreeVacb(current);
}