From: Cameron Gutman Date: Mon, 26 Dec 2011 02:52:26 +0000 (+0000) Subject: [NTOSKRNL] X-Git-Tag: backups/usb-bringup@55523~3^2~53 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=deebdc5f4042781fba0dd8fab344ca8efab17edd [NTOSKRNL] - Don't change page protection while the memory area is being deleted svn path=/trunk/; revision=54761 --- diff --git a/reactos/ntoskrnl/mm/anonmem.c b/reactos/ntoskrnl/mm/anonmem.c index a16f6534d1f..88ca97b8277 100644 --- a/reactos/ntoskrnl/mm/anonmem.c +++ b/reactos/ntoskrnl/mm/anonmem.c @@ -495,7 +495,7 @@ MiProtectVirtualMemory(IN PEPROCESS Process, MmLockAddressSpace(AddressSpace); MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, *BaseAddress); - if (MemoryArea == NULL) + if (MemoryArea == NULL || MemoryArea->DeleteInProgress) { MmUnlockAddressSpace(AddressSpace); return STATUS_UNSUCCESSFUL; diff --git a/reactos/ntoskrnl/mm/marea.c b/reactos/ntoskrnl/mm/marea.c index 1b8e3c58f8f..52e1a0f3b57 100644 --- a/reactos/ntoskrnl/mm/marea.c +++ b/reactos/ntoskrnl/mm/marea.c @@ -781,6 +781,9 @@ MmFreeMemoryArea( } } + /* There must be no page ops in progress */ + ASSERT(MemoryArea->PageOpCount == 0); + /* Remove the tree item. */ { if (MemoryArea->Parent != NULL) diff --git a/reactos/ntoskrnl/mm/pageop.c b/reactos/ntoskrnl/mm/pageop.c index 15890ea6e82..fe19e5320c6 100644 --- a/reactos/ntoskrnl/mm/pageop.c +++ b/reactos/ntoskrnl/mm/pageop.c @@ -149,6 +149,9 @@ MmGetPageOp(PMEMORY_AREA MArea, HANDLE Pid, PVOID Address, Address = (PVOID)PAGE_ROUND_DOWN(Address); Offset = PAGE_ROUND_DOWN(Offset); + /* Making a page op during marea destruction is illegal */ + ASSERT(!MArea->DeleteInProgress); + /* * Calcuate the hash value for pageop structure */