mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 00:56:39 +00: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
Notes:
sideshowbarker
2024-07-17 21:24:14 +09:00
Author: https://github.com/Rummskartoffel
Commit: 89502fc329
Pull-request: https://github.com/SerenityOS/serenity/pull/11739
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;
|
Syscall::SC_mmap_params params;
|
||||||
mmu().copy_from_vm(¶ms, params_addr, sizeof(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);
|
u32 requested_size = round_up_to_power_of_two(params.size, PAGE_SIZE);
|
||||||
FlatPtr final_address;
|
FlatPtr final_address;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue