mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:57:35 +00:00
Kernel: Make file-backed memory regions remember description permissions
This allows sys$mprotect() to honor the original readable & writable flags of the open file description as they were at the point we did the original sys$mmap(). IIUC, this is what Dr. POSIX wants us to do: https://pubs.opengroup.org/onlinepubs/9699919799/functions/mprotect.html Also, remove the bogus and racy "W^X" checking we did against mappings based on their current inode metadata. If we want to do this, we can do it properly. For now, it was not only racy, but also did blocking I/O while holding a spinlock.
This commit is contained in:
parent
30861daa93
commit
d3e8eb5918
7 changed files with 33 additions and 32 deletions
|
@ -570,7 +570,7 @@ public:
|
|||
ErrorOr<void> require_no_promises() const;
|
||||
|
||||
ErrorOr<void> validate_mmap_prot(int prot, bool map_stack, bool map_anonymous, Memory::Region const* region = nullptr) const;
|
||||
ErrorOr<void> validate_inode_mmap_prot(int prot, Inode const& inode, bool map_shared) const;
|
||||
ErrorOr<void> validate_inode_mmap_prot(int prot, bool description_readable, bool description_writable, bool map_shared) const;
|
||||
|
||||
private:
|
||||
friend class MemoryManager;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue