From 5be42e110726c5ce2537f6aae1ff2d1067329610 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Wed, 22 Oct 2003 18:26:34 +0000 Subject: [PATCH] - Added a check for a locked page in MmPageOutPhysicalAddress. svn path=/trunk/; revision=6404 --- reactos/ntoskrnl/include/internal/mm.h | 1 + reactos/ntoskrnl/mm/rmap.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index c645dfd291c..825233b6d98 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -372,6 +372,7 @@ SWAPENTRY MmGetSavedSwapEntryPage(PHYSICAL_ADDRESS PhysicalAddress); VOID MmSetCleanPage(struct _EPROCESS* Process, PVOID Address); VOID MmLockPage(PHYSICAL_ADDRESS PhysicalPage); VOID MmUnlockPage(PHYSICAL_ADDRESS PhysicalPage); +ULONG MmGetLockCountPage(PHYSICAL_ADDRESS PhysicalPage); NTSTATUS MmSafeCopyFromUser(PVOID Dest, const VOID *Src, ULONG Count); NTSTATUS MmSafeCopyToUser(PVOID Dest, const VOID *Src, ULONG Count); diff --git a/reactos/ntoskrnl/mm/rmap.c b/reactos/ntoskrnl/mm/rmap.c index bea910c8a0c..28df758c7db 100644 --- a/reactos/ntoskrnl/mm/rmap.c +++ b/reactos/ntoskrnl/mm/rmap.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: rmap.c,v 1.24 2003/10/12 17:05:48 hbirr Exp $ +/* $Id: rmap.c,v 1.25 2003/10/22 18:26:34 hbirr Exp $ * * COPYRIGHT: See COPYING in the top directory * PROJECT: ReactOS kernel @@ -229,7 +229,7 @@ MmPageOutPhysicalAddress(PHYSICAL_ADDRESS PhysicalAddress) ExAcquireFastMutex(&RmapListLock); entry = MmGetRmapListHeadPage(PhysicalAddress); - if (entry == NULL) + if (entry == NULL || MmGetLockCountPage(PhysicalAddress) != 0) { ExReleaseFastMutex(&RmapListLock); return(STATUS_UNSUCCESSFUL); @@ -437,8 +437,8 @@ MmInsertRmap(PHYSICAL_ADDRESS PhysicalAddress, PEPROCESS Process, { DPRINT1("Insert rmap (%d, 0x%.8X) 0x%.8X which doesn't match physical " "address 0x%.8X\n", Process->UniqueProcessId, Address, - MmGetPhysicalAddressForProcess(Process, Address), - PhysicalAddress) + MmGetPhysicalAddressForProcess(Process, Address).u.LowPart, + PhysicalAddress.u.LowPart) KEBUGCHECK(0); }