|
|
Message-ID: <20261102165837.24591-2-kaloz@kernel.org>
Date: Mon, 2 Nov 2026 17:58:28 +0100
From: Imre Kaloz <kaloz@...nel.org>
To: musl@...ts.openwall.com
Subject: [PATCH 01/10] pthread_sigmask: validate how by value, not as a contiguous range
SIG_BLOCK, SIG_UNBLOCK and SIG_SETMASK are not required to be
consecutive. On sparc they are 1, 2 and 4, and the range check
rejected SIG_SETMASK.
---
src/thread/pthread_sigmask.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/thread/pthread_sigmask.c b/src/thread/pthread_sigmask.c
index f188782a..e649c454 100644
--- a/src/thread/pthread_sigmask.c
+++ b/src/thread/pthread_sigmask.c
@@ -5,7 +5,8 @@
int pthread_sigmask(int how, const sigset_t *restrict set, sigset_t *restrict old)
{
int ret;
- if (set && (unsigned)how - SIG_BLOCK > 2U) return EINVAL;
+ if (set && how != SIG_BLOCK && how != SIG_UNBLOCK && how != SIG_SETMASK)
+ return EINVAL;
ret = -__syscall(SYS_rt_sigprocmask, how, set, old, _NSIG/8);
if (!ret && old) {
if (sizeof old->__bits[0] == 8) {
--
2.47.3
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.