mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 08:07:45 +00:00
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.
This commit is contained in:
parent
aa6d06b47e
commit
da13c9a264
4 changed files with 26 additions and 6 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue