Re: [PATCH] hurd: '_hurd_raise_signal' checks signal number is valid

2020-10-13 Thread Jessica Clarke
On 13 Oct 2020, at 22:16, Ludovic Courtès 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 > --- > hurd/hurd-raise.c | 3 +++ > 1 file changed, 3 in

[PATCH] hurd: '_hurd_raise_signal' checks signal number is valid

2020-10-13 Thread Ludovic Courtès
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 --- hurd/hurd-raise.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hurd/hurd-raise.c b/hurd/hurd-raise.c inde

Re: raise(-1) succeeds for programs linked against libpthread

2020-10-13 Thread Ludovic Courtès
Samuel Thibault skribis: > Ludovic Courtès, le mar. 13 oct. 2020 15:41:37 +0200, a ecrit: >> ‘pthread_kill’ passes the signal number to ‘_hurd_raise_signal’, which >> assumes it is valid: > [...] >> I suppose that before calling ‘sigaddset’, it should check whether SIGNO >> is within bounds, alon

Re: raise(-1) succeeds for programs linked against libpthread

2020-10-13 Thread Samuel Thibault
Ludovic Courtès, le mar. 13 oct. 2020 15:41:37 +0200, a ecrit: > ‘pthread_kill’ passes the signal number to ‘_hurd_raise_signal’, which > assumes it is valid: [...] > I suppose that before calling ‘sigaddset’, it should check whether SIGNO > is within bounds, along the lines of: > > if (signo <

raise(-1) succeeds for programs linked against libpthread

2020-10-13 Thread Ludovic Courtès
Hi! (Cc: bug-hurd.) Jan Nieuwenhuizen skribis: >>> #include >>> >>> int >>> main (void) >>> { >>> if (!raise (-1)) >>> return 1; >>> >>> return 0; >>> } >> >> I don’t know if it’s relevant here, but you should always use ‘-pthread’ >> both at compile time and link time: >> >> gcc