mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03: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
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
|
extern bool g_in_system_shutdown;
|
||||||
|
|
||||||
namespace Syscall {
|
namespace Syscall {
|
||||||
|
|
||||||
using Handler = auto (Process::*)(FlatPtr, FlatPtr, FlatPtr, FlatPtr) -> ErrorOr<FlatPtr>;
|
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);
|
PerformanceManager::add_syscall_event(*current_thread, regs);
|
||||||
|
|
||||||
|
if (g_in_system_shutdown)
|
||||||
|
return ENOSYS;
|
||||||
|
|
||||||
if (function >= Function::__Count) {
|
if (function >= Function::__Count) {
|
||||||
dbgln("Unknown syscall {} requested ({:p}, {:p}, {:p}, {:p})", function, arg1, arg2, arg3, arg4);
|
dbgln("Unknown syscall {} requested ({:p}, {:p}, {:p}, {:p})", function, arg1, arg2, arg3, arg4);
|
||||||
return ENOSYS;
|
return ENOSYS;
|
||||||
|
Loading…
Reference in New Issue
Block a user