mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Kernel: Reject all syscalls during the shutdown procedure
This commit is contained in:
parent
a43133b3c7
commit
7082a1f0c4
Notes:
sideshowbarker
2024-07-17 16:23:55 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/7082a1f0c4 Pull-request: https://github.com/SerenityOS/serenity/pull/20665 Issue: https://github.com/SerenityOS/serenity/issues/20560 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/BertalanD
1 changed files with 5 additions and 0 deletions
|
@ -18,6 +18,8 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
extern bool g_in_system_shutdown;
|
||||
|
||||
namespace Syscall {
|
||||
|
||||
using Handler = auto (Process::*)(FlatPtr, FlatPtr, FlatPtr, FlatPtr) -> ErrorOr<FlatPtr>;
|
||||
|
@ -43,6 +45,9 @@ ErrorOr<FlatPtr> handle(RegisterState& regs, FlatPtr function, FlatPtr arg1, Fla
|
|||
|
||||
PerformanceManager::add_syscall_event(*current_thread, regs);
|
||||
|
||||
if (g_in_system_shutdown)
|
||||
return ENOSYS;
|
||||
|
||||
if (function >= Function::__Count) {
|
||||
dbgln("Unknown syscall {} requested ({:p}, {:p}, {:p}, {:p})", function, arg1, arg2, arg3, arg4);
|
||||
return ENOSYS;
|
||||
|
|
Loading…
Reference in a new issue