Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Sep 2023 00:05:42 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Dmitry Chagin <dchagin@freebsd.org>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: 227d01c1bc7c - main - linux(4): On Linux SIGKILL can not be reset to default
Message-ID:  <ZQi7phO8tYoAcvpu@kib.kiev.ua>
In-Reply-To: <202309181453.38IErP3M046039@gitrepo.freebsd.org>
References:  <202309181453.38IErP3M046039@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 18, 2023 at 02:53:25PM +0000, Dmitry Chagin wrote:
> The branch main has been updated by dchagin:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=227d01c1bc7caf2e838ee6eef1e6a3cc81d79d1b
> 
> commit 227d01c1bc7caf2e838ee6eef1e6a3cc81d79d1b
> Author:     Dmitry Chagin <dchagin@FreeBSD.org>
> AuthorDate: 2023-09-18 14:53:01 +0000
> Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
> CommitDate: 2023-09-18 14:53:01 +0000
> 
>     linux(4): On Linux SIGKILL can not be reset to default
>     
>     MFC after:              1 week
> ---
>  sys/compat/linux/linux_signal.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c
> index e3e3fc74a6a9..9a84700b3949 100644
> --- a/sys/compat/linux/linux_signal.c
> +++ b/sys/compat/linux/linux_signal.c
> @@ -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);
This is excessive: look at kern_sigaction() around line 822.

>  	} else
>  		nsa = NULL;
> -	sig = linux_to_bsd_signal(linux_sig);
>  
>  	error = kern_sigaction(td, sig, nsa, osa, 0);
>  	if (error != 0)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZQi7phO8tYoAcvpu>