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
commit 8924b1f532
Notes: sideshowbarker 2024-07-18 03:33:07 +09:00

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())