summaryrefslogtreecommitdiff
path: root/Kernel/MemoryManager.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-11-03 11:36:45 +0100
committerAndreas Kling <awesomekling@gmail.com>2018-11-03 11:36:45 +0100
commitda13c9a2648de7c7d799952389e228e739dc486d (patch)
tree62f5c37e0116a5e9353faa6e7a66b9174477c311 /Kernel/MemoryManager.h
parentaa6d06b47ee7f510f153fa2971be75533a9295ee (diff)
downloadserenity-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.h4
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()