mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 18:46:18 +00:00
Kernel: Fix EINVAL when mmaping with address and no MAP_FIXED
The current behavior accidently trys to allocate 0 bytes when a non-null address is provided and MAP_FIXED is specified. This is clearly a bug.
This commit is contained in:
parent
0b9a9c7708
commit
f6943c85b0
|
@ -198,7 +198,7 @@ ErrorOr<FlatPtr> Process::sys$mmap(Userspace<Syscall::SC_mmap_params const*> use
|
|||
Memory::VirtualRange requested_range { VirtualAddress { addr }, rounded_size };
|
||||
if (addr && !(map_fixed || map_fixed_noreplace)) {
|
||||
// If there's an address but MAP_FIXED wasn't specified, the address is just a hint.
|
||||
requested_range = { {}, 0 };
|
||||
requested_range = { {}, rounded_size };
|
||||
}
|
||||
|
||||
if (map_anonymous) {
|
||||
|
|
Loading…
Reference in a new issue