]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: Fix hang in _hurd_raise_signal from pthread_kill
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 6 Jun 2020 23:55:54 +0000 (01:55 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 6 Jun 2020 23:57:26 +0000 (01:57 +0200)
When ss is not NULL, it is assumed to be locked.

* hurd/hurd-raise.c (_hurd_raise_signal): Unlock before returning an
error if ss is not NULL.

hurd/hurd-raise.c

index af464377b61a4db1b2288b43ed932c01b583622c..865e498bf97709774007553cd9c052822d0395fd 100644 (file)
@@ -29,7 +29,11 @@ _hurd_raise_signal (struct hurd_sigstate *ss,
                    int signo, const struct hurd_signal_detail *detail)
 {
   if (signo <= 0 || signo >= NSIG)
-    return EINVAL;
+    {
+      if (ss)
+       __spin_unlock (&ss->lock);
+      return EINVAL;
+    }
 
   if (ss == NULL)
     {