linux(4): On Linux SIGKILL can not be reset to default

MFC after:		1 week
This commit is contained in:
Dmitry Chagin 2023-09-18 17:53:01 +03:00
parent 794328fbc1
commit 227d01c1bc

View File

@ -170,6 +170,7 @@ linux_do_sigaction(struct thread *td, int linux_sig, l_sigaction_t *linux_nsa,
if (!LINUX_SIG_VALID(linux_sig))
return (EINVAL);
sig = linux_to_bsd_signal(linux_sig);
osa = (linux_osa != NULL) ? &oact : NULL;
if (linux_nsa != NULL) {
@ -180,9 +181,11 @@ linux_do_sigaction(struct thread *td, int linux_sig, l_sigaction_t *linux_nsa,
linux_ktrsigset(&linux_nsa->lsa_mask,
sizeof(linux_nsa->lsa_mask));
#endif
if ((sig == SIGKILL || sig == SIGSTOP) &&
nsa->sa_handler == SIG_DFL)
return (EINVAL);
} else
nsa = NULL;
sig = linux_to_bsd_signal(linux_sig);
error = kern_sigaction(td, sig, nsa, osa, 0);
if (error != 0)