From 848eaf2220fb57cc5b9726a9dc298b79ab99b4df Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Thu, 24 Feb 2022 22:29:45 +0330 Subject: [PATCH] Kernel: Reject sigaction() with SA_SIGINFO We can't handle this, so let sigaction() fail instead of PANIC()'ing later when we try to dispatch a signal with SA_SIGINFO set. --- Kernel/Syscalls/sigaction.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Kernel/Syscalls/sigaction.cpp b/Kernel/Syscalls/sigaction.cpp index 80e14c44a8..e9b5c4c99e 100644 --- a/Kernel/Syscalls/sigaction.cpp +++ b/Kernel/Syscalls/sigaction.cpp @@ -68,6 +68,8 @@ ErrorOr Process::sys$sigaction(int signum, Userspace } if (user_act) { auto act = TRY(copy_typed_from_user(user_act)); + if (act.sa_flags & SA_SIGINFO) + return ENOTSUP; action.mask = act.sa_mask; action.flags = act.sa_flags; action.handler_or_sigaction = VirtualAddress { reinterpret_cast(act.sa_sigaction) };