public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Jessica Clarke <jrtc27@jrtc27.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org,
	Samuel Thibault <samuel.thibault@gnu.org>,
	Jan Nieuwenhuizen <janneke@gnu.org>
Subject: Re: [PATCH] hurd: '_hurd_raise_signal' checks signal number is valid
Date: Tue, 13 Oct 2020 22:20:15 +0100	[thread overview]
Message-ID: <ABF42DD0-CC61-468A-8CB2-8A4CBA328177@jrtc27.com> (raw)
In-Reply-To: <20201013211657.1869-1-ludo@gnu.org>

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


  reply	other threads:[~2020-10-13 21:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201013135744.mpizainhz43e5vkl@function>
2020-10-13 21:16 ` Ludovic Courtès
2020-10-13 21:20   ` Jessica Clarke [this message]
2020-10-14 10:43     ` Samuel Thibault
2020-10-14 10:54   ` Andreas Schwab
2020-10-14 16:55     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ABF42DD0-CC61-468A-8CB2-8A4CBA328177@jrtc27.com \
    --to=jrtc27@jrtc27.com \
    --cc=bug-hurd@gnu.org \
    --cc=janneke@gnu.org \
    --cc=libc-alpha@sourceware.org \
    --cc=ludo@gnu.org \
    --cc=samuel.thibault@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).