1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:07:35 +00:00

Kernel: Create and use USER_RANGE_CEILING

We had an inconsistency in valid user addresses. is_user_range() was
checking against the kernel base address, but previous changes caused
the maximum valid user addressable range to be 32 MiB below that.

This patch stops mmap(MAP_FIXED) of a range between these two bounds
from panic-ing the kernel in RangeAllocator::allocate_specific.
This commit is contained in:
Andrew Kaster 2021-07-06 20:25:22 -06:00 committed by Andreas Kling
parent ab196b484a
commit 578d45b480
3 changed files with 4 additions and 2 deletions

View file

@ -278,7 +278,7 @@ void VMObject::for_each_region(Callback callback)
inline bool is_user_address(VirtualAddress vaddr)
{
return vaddr.get() < KERNEL_BASE;
return vaddr.get() < USER_RANGE_CEILING;
}
inline bool is_user_range(VirtualAddress vaddr, size_t size)