[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hurd: '_hurd_raise_signal' checks signal number is valid
From: |
Jessica Clarke |
Subject: |
Re: [PATCH] hurd: '_hurd_raise_signal' checks signal number is valid |
Date: |
Tue, 13 Oct 2020 22:20:15 +0100 |
On 13 Oct 2020, at 22:16, Ludovic Courtès <ludo@gnu.org> wrote:
>
> Previously, 'pthread_kill (pthread_self (), -1)' would wrongfully
> succeed:
>
> https://lists.gnu.org/archive/html/guix-devel/2020-10/msg00152.html
>
> Reported-by: Jan Nieuwenhuizen <janneke@gnu.org>
> ---
> hurd/hurd-raise.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/hurd/hurd-raise.c b/hurd/hurd-raise.c
> index d53fd417d2..58b4ffcc83 100644
> --- a/hurd/hurd-raise.c
> +++ b/hurd/hurd-raise.c
> @@ -28,6 +28,9 @@ int
> _hurd_raise_signal (struct hurd_sigstate *ss,
> int signo, const struct hurd_signal_detail *detail)
> {
> + if (signo < 1 || signo >= _NSIG)
> + return EINVAL;
> +
From pthread_kill(3):
If sig is 0, then no signal is sent, but error checking is still performed.
I interpret that as meaning it validates thread but ignores sig.
Jess