From 98256a4f5d9088e966eae56915ac0241785268a5 Mon Sep 17 00:00:00 2001 From: Ahmed Arif Date: Mon, 27 Jul 2026 16:44:40 +0200 Subject: [PATCH] [NTOS:MM] Allow contiguous-memory frees at DISPATCH_LEVEL (#9349) MmFreeContiguousMemory() is callable at up to DISPATCH_LEVEL, but MiFreeContiguousMemory() used PAGED_CODE(), which incorrectly asserted above APC_LEVEL in checked builds. Replace it with an assertion that enforces the exported IRQL contract. --- ntoskrnl/mm/ARM3/contmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntoskrnl/mm/ARM3/contmem.c b/ntoskrnl/mm/ARM3/contmem.c index e8895b0a2fe..5c58fa7c289 100644 --- a/ntoskrnl/mm/ARM3/contmem.c +++ b/ntoskrnl/mm/ARM3/contmem.c @@ -464,7 +464,7 @@ MiFreeContiguousMemory(IN PVOID BaseAddress) PFN_NUMBER PageFrameIndex, LastPage, PageCount; PMMPFN Pfn1, StartPfn; PMMPTE PointerPte; - PAGED_CODE(); + ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL); // // First, check if the memory came from initial nonpaged pool, or expansion