Merge pull request #429 from polybiusproxy/memory-vq

core/memory: Fix error on virtual queries of reserved regions
This commit is contained in:
georgemoralis 2024-08-14 17:16:46 +03:00 committed by GitHub
commit 4b11dabd9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -273,10 +273,10 @@ int MemoryManager::VirtualQuery(VAddr addr, int flags,
std::scoped_lock lk{mutex}; std::scoped_lock lk{mutex};
auto it = FindVMA(addr); auto it = FindVMA(addr);
if (!it->second.IsMapped() && flags == 1) { if (it->second.type == VMAType::Free && flags == 1) {
it++; it++;
} }
if (!it->second.IsMapped()) { if (it->second.type == VMAType::Free) {
LOG_WARNING(Kernel_Vmm, "VirtualQuery on free memory region"); LOG_WARNING(Kernel_Vmm, "VirtualQuery on free memory region");
return ORBIS_KERNEL_ERROR_EACCES; return ORBIS_KERNEL_ERROR_EACCES;
} }