From f114209782a0f44fa6b80cc3aa1e7d583d5dacea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Fri, 4 Dec 2020 09:10:13 +0100 Subject: [PATCH] [NTOS/MM] Do not zero out the tail of the segment if the mapping is not an image --- ntoskrnl/mm/section.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c index 08e68a20c33..6b6a6cb94be 100644 --- a/ntoskrnl/mm/section.c +++ b/ntoskrnl/mm/section.c @@ -1205,7 +1205,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, Status = STATUS_SUCCESS; } - if ((SegOffset + PAGE_SIZE) > MemoryArea->SectionData.Segment->RawLength.QuadPart) + if ((MemoryArea->VadNode.u.VadFlags.VadType == VadImageMap) && ((SegOffset + PAGE_SIZE) > MemoryArea->SectionData.Segment->RawLength.QuadPart)) { KIRQL OldIrql; PUCHAR PageMap;