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

Kernel: Add "map_fixed" pledge promise

This is a new promise that guards access to mmap() with MAP_FIXED.

Fixed-address mappings are rarely used, but can be useful if you are
trying to groom the process address space for malicious purposes.

None of our programs need this at the moment, as the only user of
MAP_FIXED is DynamicLoader, but the fixed mappings are constructed
before the process has had a chance to pledge anything.
This commit is contained in:
Andreas Kling 2021-02-21 01:08:48 +01:00
parent a0cbb9068b
commit 84b2d4c475
3 changed files with 6 additions and 0 deletions

View file

@ -82,6 +82,7 @@ void kgettimeofday(timeval&);
__ENUMERATE_PLEDGE_PROMISE(sigaction) \
__ENUMERATE_PLEDGE_PROMISE(setkeymap) \
__ENUMERATE_PLEDGE_PROMISE(prot_exec) \
__ENUMERATE_PLEDGE_PROMISE(map_fixed) \
__ENUMERATE_PLEDGE_PROMISE(getkeymap)
enum class Pledge : u32 {