Kernel: Hold InodeVMObject reference while inspecting it in sys$mmap()
This commit is contained in:
parent
b8db585a83
commit
af28a8ad11
Notes:
sideshowbarker
2024-07-19 00:26:31 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/af28a8ad117
1 changed files with 3 additions and 3 deletions
|
@ -68,10 +68,10 @@ static bool validate_inode_mmap_prot(const Process& process, int prot, const Ino
|
|||
if ((prot & PROT_WRITE) && !metadata.may_write(process))
|
||||
return false;
|
||||
InterruptDisabler disabler;
|
||||
if (inode.shared_vmobject()) {
|
||||
if ((prot & PROT_EXEC) && inode.shared_vmobject()->writable_mappings())
|
||||
if (auto shared_vmobject = inode.shared_vmobject()) {
|
||||
if ((prot & PROT_EXEC) && shared_vmobject->writable_mappings())
|
||||
return false;
|
||||
if ((prot & PROT_WRITE) && inode.shared_vmobject()->executable_mappings())
|
||||
if ((prot & PROT_WRITE) && shared_vmobject->executable_mappings())
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue