From 049976057cd4470530b2f112ee684aa073b7110b Mon Sep 17 00:00:00 2001 From: Stephen Miller Date: Wed, 7 May 2025 22:03:23 -0500 Subject: [PATCH] Proper error behavior in QueryProtection Might as well handle this properly while I'm here. --- src/core/memory.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index f35de7eba..fddee3187 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -528,7 +528,10 @@ int MemoryManager::QueryProtection(VAddr addr, void** start, void** end, u32* pr const auto it = FindVMA(addr); const auto& vma = it->second; - ASSERT_MSG(vma.type != VMAType::Free, "Provided address is not mapped"); + if (!vma.Contains(addr, 0) || vma.IsFree()) { + LOG_ERROR(Kernel_Vmm, "Address {:#x} is not mapped", addr); + return ORBIS_KERNEL_ERROR_EACCES; + } if (start != nullptr) { *start = reinterpret_cast(vma.base);