mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:37:44 +00:00
Kernel: Round up ranges to page size multiples in munmap and mprotect
This prevents passing bad inputs to RangeAllocator who then asserts. Found by fuzz-syscalls. :^)
This commit is contained in:
parent
e1dbf74f15
commit
7551090056
2 changed files with 18 additions and 10 deletions
|
@ -265,6 +265,11 @@ inline bool is_user_range(VirtualAddress vaddr, size_t size)
|
|||
return is_user_address(vaddr) && is_user_address(vaddr.offset(size));
|
||||
}
|
||||
|
||||
inline bool is_user_range(const Range& range)
|
||||
{
|
||||
return is_user_range(range.base(), range.size());
|
||||
}
|
||||
|
||||
inline bool PhysicalPage::is_shared_zero_page() const
|
||||
{
|
||||
return this == &MM.shared_zero_page();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue