1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:37:35 +00:00

Kernel: Crash on memory access in non-readable regions

This patch makes it possible to make memory regions non-readable.
This is enforced using the "present" bit in the page tables.
A process that hits an not-present page fault in a non-readable
region will be crashed.
This commit is contained in:
Andreas Kling 2019-12-02 19:14:16 +01:00
parent ddd5411472
commit f41ae755ec
5 changed files with 41 additions and 2 deletions

View file

@ -113,6 +113,14 @@ public:
m_access &= ~Access::Write;
}
void set_readable(bool b)
{
if (b)
m_access |= Access::Read;
else
m_access &= ~Access::Read;
}
void map(PageDirectory&);
enum class ShouldDeallocateVirtualMemoryRange {
No,