Kernel: Reject all syscalls during the shutdown procedure

This commit is contained in:
Liav A 2023-08-19 12:01:42 +03:00 committed by Andrew Kaster
parent a43133b3c7
commit 7082a1f0c4
Notes: sideshowbarker 2024-07-17 16:23:55 +09:00

View file

@ -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;