mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
Kernel: Disable big process lock for sys$get_stack_bounds
This syscall only reads from the shared m_space field, but that field is only over written to by Process::attach_resources, before the process was initialized (aka, before syscalls can happen), by Process::finalize which is only called after all the process' threads have exited (aka, syscalls can not happen anymore), and by Process::do_exec which calls all other syscall-capable threads before doing so. Space's find_region_containing already holds its own lock, and as such there's no need to hold the big lock.
This commit is contained in:
parent
d40038a04f
commit
efeb01e35f
Notes:
sideshowbarker
2024-07-18 07:23:26 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/efeb01e35fc Pull-request: https://github.com/SerenityOS/serenity/pull/9236 Reviewed-by: https://github.com/tomuta ✅
@ -177,7 +177,7 @@ enum class NeedsBigProcessLock {
|
||||
S(unveil, NeedsBigProcessLock::Yes) \
|
||||
S(perf_event, NeedsBigProcessLock::Yes) \
|
||||
S(shutdown, NeedsBigProcessLock::Yes) \
|
||||
S(get_stack_bounds, NeedsBigProcessLock::Yes) \
|
||||
S(get_stack_bounds, NeedsBigProcessLock::No) \
|
||||
S(ptrace, NeedsBigProcessLock::Yes) \
|
||||
S(sendfd, NeedsBigProcessLock::Yes) \
|
||||
S(recvfd, NeedsBigProcessLock::Yes) \
|
||||
|
@ -11,7 +11,7 @@ namespace Kernel {
|
||||
|
||||
KResultOr<FlatPtr> Process::sys$get_stack_bounds(Userspace<FlatPtr*> user_stack_base, Userspace<size_t*> user_stack_size)
|
||||
{
|
||||
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
|
||||
VERIFY_NO_PROCESS_BIG_LOCK(this);
|
||||
auto& regs = Thread::current()->get_register_dump_from_stack();
|
||||
FlatPtr stack_pointer = regs.userspace_sp();
|
||||
auto* stack_region = address_space().find_region_containing(Memory::VirtualRange { VirtualAddress(stack_pointer), 1 });
|
||||
|
Loading…
Reference in New Issue
Block a user