mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
Kernel: Don't disable interrupts in validate_inode_mmap_prot
There's no need to disable interrupts when trying to access an inode's shared vmobject. Additionally, Inode::shared_vmobject() acquires a Mutex which is a recipe for deadlock if acquired with interrupts disabled.
This commit is contained in:
parent
2038d2c49e
commit
8e70b85215
1 changed files with 0 additions and 2 deletions
|
@ -5,7 +5,6 @@
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Kernel/Arch/x86/InterruptDisabler.h>
|
|
||||||
#include <Kernel/Arch/x86/MSR.h>
|
#include <Kernel/Arch/x86/MSR.h>
|
||||||
#include <Kernel/Arch/x86/SmapDisabler.h>
|
#include <Kernel/Arch/x86/SmapDisabler.h>
|
||||||
#include <Kernel/FileSystem/FileDescription.h>
|
#include <Kernel/FileSystem/FileDescription.h>
|
||||||
|
@ -115,7 +114,6 @@ static bool validate_inode_mmap_prot(const Process& process, int prot, const Ino
|
||||||
// keep a Custody or something from mmap time.
|
// keep a Custody or something from mmap time.
|
||||||
if ((prot & PROT_WRITE) && !metadata.may_write(process))
|
if ((prot & PROT_WRITE) && !metadata.may_write(process))
|
||||||
return false;
|
return false;
|
||||||
InterruptDisabler disabler;
|
|
||||||
if (auto shared_vmobject = inode.shared_vmobject()) {
|
if (auto shared_vmobject = inode.shared_vmobject()) {
|
||||||
if ((prot & PROT_EXEC) && shared_vmobject->writable_mappings())
|
if ((prot & PROT_EXEC) && shared_vmobject->writable_mappings())
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue