mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
UserspaceEmulator: Interpret zero-alignment as page-sized alignment
This commit fixes an issue where zero-alignment would lead to the requested range being allocated outside of the total available range, hitting an assert in RangeAllocator::allocate_anywhere().
This commit is contained in:
parent
963b0f76cf
commit
89502fc329
1 changed files with 1 additions and 0 deletions
|
@ -866,6 +866,7 @@ u32 Emulator::virt$mmap(u32 params_addr)
|
|||
{
|
||||
Syscall::SC_mmap_params params;
|
||||
mmu().copy_from_vm(¶ms, params_addr, sizeof(params));
|
||||
params.alignment = params.alignment ? params.alignment : PAGE_SIZE;
|
||||
|
||||
u32 requested_size = round_up_to_power_of_two(params.size, PAGE_SIZE);
|
||||
FlatPtr final_address;
|
||||
|
|
Loading…
Add table
Reference in a new issue