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

Kernel: Fix mix-up between MAP_STACK/MAP_ANONYMOUS in prot validation

This commit is contained in:
Andreas Kling 2021-01-30 10:30:17 +01:00
parent e55ef70e5e
commit 123c37e1c0

View file

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