mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 08:28:11 +00:00
Kernel: Mark mmap()-created regions with a special bit
Then only allow regions with that bit to be manipulated via munmap() and mprotect(). This prevents messing with non-mmap()ed regions in a process's address space (stacks, shared buffers, ...)
This commit is contained in:
parent
35c26a06fc
commit
3dc87be891
2 changed files with 14 additions and 0 deletions
|
@ -53,6 +53,9 @@ public:
|
|||
bool is_stack() const { return m_stack; }
|
||||
void set_stack(bool stack) { m_stack = stack; }
|
||||
|
||||
bool is_mmap() const { return m_mmap; }
|
||||
void set_mmap(bool mmap) { m_mmap = mmap; }
|
||||
|
||||
bool is_user_accessible() const { return m_user_accessible; }
|
||||
|
||||
PageFaultResponse handle_fault(const PageFault&);
|
||||
|
@ -145,5 +148,6 @@ private:
|
|||
bool m_shared { false };
|
||||
bool m_user_accessible { false };
|
||||
bool m_stack { false };
|
||||
bool m_mmap { false };
|
||||
mutable OwnPtr<Bitmap> m_cow_map;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue