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
Notes: sideshowbarker 2024-07-17 11:34:34 +09:00

View file

@ -141,7 +141,7 @@ ErrorOr<FlatPtr> Process::sys$mmap(Userspace<Syscall::SC_mmap_params const*> use
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));
}