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

Kernel: Allow PROT_NONE in mmap and mprotect for stack regions

To allow for userspace guard pages (ruby uses this).
Redundant since serenity creates them automatically,
but should be allowed anyway.
This commit is contained in:
Eric Seifert 2021-09-22 17:56:12 -07:00 committed by Brian Gianforcaro
parent 925f21353e
commit 8924b1f532

View file

@ -80,12 +80,8 @@ static bool validate_mmap_prot(int prot, bool map_stack, bool map_anonymous, Mem
if (make_writable && make_executable)
return false;
if (map_stack) {
if (make_executable)
return false;
if (!make_readable || !make_writable)
return false;
}
if (map_stack && make_executable)
return false;
if (region) {
if (make_writable && region->has_been_executable())