1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:54:57 +00:00

Kernel: Check flags for MAP_FIXED instead of prot in sys$mmap

We were accidentally not enforcing the map_fixed pledge
This commit is contained in:
Idan Horowitz 2022-07-27 00:41:34 +03:00
parent 6b08b18a9a
commit 01318d8f9b

View file

@ -141,7 +141,7 @@ ErrorOr<FlatPtr> Process::sys$mmap(Userspace<Syscall::SC_mmap_params const*> use
TRY(require_promise(Pledge::prot_exec)); TRY(require_promise(Pledge::prot_exec));
} }
if (prot & MAP_FIXED || prot & MAP_FIXED_NOREPLACE) { if (flags & MAP_FIXED || flags & MAP_FIXED_NOREPLACE) {
TRY(require_promise(Pledge::map_fixed)); TRY(require_promise(Pledge::map_fixed));
} }