Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <rchjrjzzgk4z7ezs5o2rdtdnk4l56nqgxthyv3npikwzbyfa3i2@tarta.nabijaczleweli.xyz>
Date: Sun, 1 Jun 2025 15:46:42 +0200
From: наб <nabijaczleweli@...ijaczleweli.xyz>
To: musl@...ts.openwall.com
Subject: [PATCH] sigaction: don't sign-extend sa_flags

Before:
  rt_sigaction(SIGBUS, {sa_handler=0x401270, sa_mask=[], sa_flags=SA_RESTORER|SA_RESETHAND|SA_SIGINFO|0xffffffff00000000, sa_restorer=0x4019d1}, NULL, 8) = 0

After:
  rt_sigaction(SIGBUS, {sa_handler=0x401270, sa_mask=[], sa_flags=SA_RESTORER|SA_RESETHAND|SA_SIGINFO, sa_restorer=0x4019d9}, NULL, 8) = 0
---
 src/signal/sigaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/signal/sigaction.c b/src/signal/sigaction.c
index e45308f..cc4ca20 100644
--- a/src/signal/sigaction.c
+++ b/src/signal/sigaction.c
@@ -44,7 +44,7 @@ int __libc_sigaction(int sig, const struct sigaction *restrict sa, struct sigact
 			}
 		}
 		ksa.handler = sa->sa_handler;
-		ksa.flags = sa->sa_flags;
+		ksa.flags = (unsigned)sa->sa_flags;
 #ifdef SA_RESTORER
 		ksa.flags |= SA_RESTORER;
 		ksa.restorer = (sa->sa_flags & SA_SIGINFO) ? __restore_rt : __restore;
-- 
2.39.5

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

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.