From 48027a80588e03768a9f8e227227a3821e263414 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 6 Apr 2024 10:21:33 +0300 Subject: [PATCH] [NTOS:MM] Remove obsolete code path In MmCleanProcessAddressSpace we already delete VADs that are RosMm memory areas by calling MiRosCleanupMemoryArea, so we never reach the later check. This code path is from a time when VADs and memory areas lived in different tables, which is no longer the case. --- ntoskrnl/mm/ARM3/procsup.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ntoskrnl/mm/ARM3/procsup.c b/ntoskrnl/mm/ARM3/procsup.c index 77ca7befd70..6c11bb4cf7d 100644 --- a/ntoskrnl/mm/ARM3/procsup.c +++ b/ntoskrnl/mm/ARM3/procsup.c @@ -1327,14 +1327,6 @@ MmCleanProcessAddressSpace(IN PEPROCESS Process) MiUnlockProcessWorkingSetUnsafe(Process, Thread); } - /* Skip ARM3 fake VADs, they'll be freed by MmDeleteProcessAddresSpace */ - if (Vad->u.VadFlags.Spare == 1) - { - /* Set a flag so MmDeleteMemoryArea knows to free, but not to remove */ - Vad->u.VadFlags.Spare = 2; - continue; - } - /* Free the VAD memory */ ExFreePool(Vad);