fix libc-internal signal blocking on mips archs
authorRich Felker <dalias@aerifal.cx>
Fri, 30 Jul 2021 03:24:58 +0000 (23:24 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 30 Jul 2021 03:24:58 +0000 (23:24 -0400)
due to historical reasons, the mips signal set has 128 bits rather
than 64 like on every other arch. this was special-cased correctly, at
least for 32-bit mips, at one time, but was inadvertently broken in
commit 7c440977db9444d7e6b1c3dcb1fdf4ee49ca4158, and seems never to
have been right on mips64/n32.

as consequenct of this bug, applications making use of high realtime
signal numbers on mips may have been able to execute application code
in contexts where doing so was unsafe.

src/signal/block.c

index d7f6100..cc8698f 100644 (file)
@@ -3,9 +3,9 @@
 #include <signal.h>
 
 static const unsigned long all_mask[] = {
-#if ULONG_MAX == 0xffffffff && _NSIG == 129
+#if ULONG_MAX == 0xffffffff && _NSIG > 65
        -1UL, -1UL, -1UL, -1UL
-#elif ULONG_MAX == 0xffffffff
+#elif ULONG_MAX == 0xffffffff || _NSIG > 65
        -1UL, -1UL
 #else
        -1UL