1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 13:45:07 +00:00

Kernel: Don't hog MM lock in find_region_from_vaddr()

We don't want to be holding the MM lock if it's a user region and we
have to consult the page directory, since that can lead to a deadlock
if we don't already have the page directory lock.
This commit is contained in:
Andreas Kling 2021-08-09 02:18:59 +02:00
parent 96c7b70de3
commit 95c8e421ae

View file

@ -673,7 +673,6 @@ void MemoryManager::validate_syscall_preconditions(AddressSpace& space, Register
Region* MemoryManager::find_region_from_vaddr(VirtualAddress vaddr)
{
ScopedSpinLock lock(s_mm_lock);
if (auto* region = kernel_region_from_vaddr(vaddr))
return region;
auto page_directory = PageDirectory::find_by_cr3(read_cr3());