mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 11:42:38 +03: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
Notes:
sideshowbarker
2024-07-18 05:08:53 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/8e70b852156 Pull-request: https://github.com/SerenityOS/serenity/pull/9580 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/bgianfo
@ -5,7 +5,6 @@
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <Kernel/Arch/x86/InterruptDisabler.h>
|
||||
#include <Kernel/Arch/x86/MSR.h>
|
||||
#include <Kernel/Arch/x86/SmapDisabler.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.
|
||||
if ((prot & PROT_WRITE) && !metadata.may_write(process))
|
||||
return false;
|
||||
InterruptDisabler disabler;
|
||||
if (auto shared_vmobject = inode.shared_vmobject()) {
|
||||
if ((prot & PROT_EXEC) && shared_vmobject->writable_mappings())
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user