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

Kernel: Prevent mmap-ing as both fixed and randomized

This commit is contained in:
Sahan Fernando 2021-01-29 10:28:27 +11:00 committed by Andreas Kling
parent 22b0ff05d4
commit 6876b9a514

View file

@ -128,6 +128,9 @@ void* Process::sys$mmap(Userspace<const Syscall::SC_mmap_params*> user_params)
if (!map_shared && !map_private)
return (void*)-EINVAL;
if (map_fixed && map_randomized)
return (void*)-EINVAL;
if (!validate_mmap_prot(prot, map_stack))
return (void*)-EINVAL;