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

Kernel: Implement an axallowed mount option

Similar to `W^X` and `wxallowed`, this allows for anonymous executable
mappings.
This commit is contained in:
Tim Schumacher 2022-05-05 18:30:24 +02:00 committed by Brian Gianforcaro
parent 6187cf72cc
commit 5efa8e507b
5 changed files with 8 additions and 1 deletions

View file

@ -75,7 +75,7 @@ ErrorOr<void> Process::validate_mmap_prot(int prot, bool map_stack, bool map_ano
bool make_writable = prot & PROT_WRITE;
bool make_executable = prot & PROT_EXEC;
if (map_anonymous && make_executable)
if (map_anonymous && make_executable && !(executable()->mount_flags() & MS_AXALLOWED))
return EINVAL;
if (map_stack && make_executable)