diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-11-03 11:36:45 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-11-03 11:36:45 +0100 |
commit | da13c9a2648de7c7d799952389e228e739dc486d (patch) | |
tree | 62f5c37e0116a5e9353faa6e7a66b9174477c311 /Kernel/MemoryManager.h | |
parent | aa6d06b47ee7f510f153fa2971be75533a9295ee (diff) | |
download | serenity-da13c9a2648de7c7d799952389e228e739dc486d.zip |
Map pages in read-only ELF sections as non-writable.
This is so cool! :^) Now you'll crash if you try to write into your
.text or .rodata segments.
Diffstat (limited to 'Kernel/MemoryManager.h')
-rw-r--r-- | Kernel/MemoryManager.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Kernel/MemoryManager.h b/Kernel/MemoryManager.h index 3c3df0d58d..0ebe056666 100644 --- a/Kernel/MemoryManager.h +++ b/Kernel/MemoryManager.h @@ -38,7 +38,7 @@ private: }; struct Region : public Retainable<Region> { - Region(LinearAddress, size_t, RetainPtr<Zone>&&, String&&); + Region(LinearAddress, size_t, RetainPtr<Zone>&&, String&&, bool r, bool w); ~Region(); RetainPtr<Region> clone(); @@ -46,6 +46,8 @@ struct Region : public Retainable<Region> { size_t size { 0 }; RetainPtr<Zone> zone; String name; + bool is_readable { true }; + bool is_writable { true }; }; #define MM MemoryManager::the() |