mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +00:00
Kernel: Fix overly loose MemoryManager::kernel_region_from_vaddr()
It's not enough to just find the largest-address-not-above the argument,
we must also check that the found region actually contains the argument.
Regressed in a23edd42b8
, thanks to Idan
for pointing this out.
This commit is contained in:
parent
ecccd511fa
commit
813593a485
Notes:
sideshowbarker
2024-07-17 22:58:54 +09:00
Author: https://github.com/awesomekling
Commit: 813593a485
1 changed files with 1 additions and 1 deletions
|
@ -623,7 +623,7 @@ Region* MemoryManager::kernel_region_from_vaddr(VirtualAddress vaddr)
|
|||
auto* region_ptr = MM.m_kernel_regions.find_largest_not_above(vaddr.get());
|
||||
if (!region_ptr)
|
||||
return nullptr;
|
||||
return *region_ptr;
|
||||
return (*region_ptr)->contains(vaddr) ? *region_ptr : nullptr;
|
||||
}
|
||||
|
||||
Region* MemoryManager::find_user_region_from_vaddr_no_lock(AddressSpace& space, VirtualAddress vaddr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue