mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03:00
Kernel: Move validate_syscall_preconditions outside of the big lock
Now that we hold the space lock for the duration of the validation it should be safe to move the validation outside the big lock.
This commit is contained in:
parent
85e95105c6
commit
354e18a5a0
Notes:
sideshowbarker
2024-07-18 08:42:58 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/354e18a5a02 Pull-request: https://github.com/SerenityOS/serenity/pull/8864 Reviewed-by: https://github.com/IdanHo Reviewed-by: https://github.com/gunnarbeutner ✅ Reviewed-by: https://github.com/tomuta ✅
@ -196,9 +196,6 @@ NEVER_INLINE void syscall_handler(TrapFrame* trap)
|
||||
PANIC("Syscall from process with IOPL != 0");
|
||||
}
|
||||
|
||||
// NOTE: We take the big process lock before inspecting memory regions.
|
||||
process.big_lock().lock();
|
||||
|
||||
MM.validate_syscall_preconditions(process.space(), regs);
|
||||
|
||||
FlatPtr function;
|
||||
@ -207,6 +204,9 @@ NEVER_INLINE void syscall_handler(TrapFrame* trap)
|
||||
FlatPtr arg3;
|
||||
regs.capture_syscall_params(function, arg1, arg2, arg3);
|
||||
|
||||
process.big_lock().lock();
|
||||
|
||||
|
||||
auto result = Syscall::handle(regs, function, arg1, arg2, arg3);
|
||||
if (result.is_error()) {
|
||||
regs.set_return_reg(result.error());
|
||||
|
Loading…
Reference in New Issue
Block a user