about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2021-07-29 23:24:58 -0400
committerRich Felker <dalias@aerifal.cx>2021-07-29 23:24:58 -0400
commit3f701faace7addc75d16dea8a6cd769fa5b3f260 (patch)
tree74f78ed6b69430ed3ca78f75eaf6ffdff6a67415 /src
parent0fbd7d6683d04dcaa636df53e7fce69ece746241 (diff)
downloadmusl-3f701faace7addc75d16dea8a6cd769fa5b3f260.tar.gz
musl-3f701faace7addc75d16dea8a6cd769fa5b3f260.tar.xz
musl-3f701faace7addc75d16dea8a6cd769fa5b3f260.zip
fix libc-internal signal blocking on mips archs
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.
Diffstat (limited to 'src')
-rw-r--r--src/signal/block.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/signal/block.c b/src/signal/block.c
index d7f61001..cc8698f0 100644
--- a/src/signal/block.c
+++ b/src/signal/block.c
@@ -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