From 9af4aa2e25e564c2f3075a60ab94147d15aadaff Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Sun, 19 Apr 2026 16:20:14 -0500 Subject: [PATCH] Kernel.Vmm: Proper address checking in QueryProtection (#4286) --- src/core/memory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 442937a5a..0335df6f6 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -951,7 +951,11 @@ s32 MemoryManager::UnmapMemoryImpl(VAddr virtual_addr, u64 size) { s32 MemoryManager::QueryProtection(VAddr addr, void** start, void** end, u32* prot) { std::shared_lock lk{mutex}; - ASSERT_MSG(IsValidMapping(addr), "Attempted to access invalid address {:#x}", addr); + VAddr min_query_addr = impl.SystemManagedVirtualBase(); + if (addr < min_query_addr) { + LOG_ERROR(Kernel_Vmm, "Address {:#x} is not mapped", addr); + return ORBIS_KERNEL_ERROR_EACCES; + } const auto it = FindVMA(addr); const auto& vma = it->second;