forked from pool/glibc
* The <stdbit.h> header type-generic macros have been changed when using GCC 14.1 or later to use __builtin_stdc_bit_ceil etc. built-in functions * The GNU C Library now supports a feature test macro _ISOC23_SOURCE to enable features from the ISO C23 standard * The ISO C23 function families introduced in TS 18661-4:2015 are now supported in <math.h> * A new tunable, glibc.rtld.enable_secure, can be used to run a program as if it were a setuid process * On Linux, the epoll header was updated to include epoll ioctl definitions and the related structure added in Linux kernel 6.9 * The fortify functionality has been significantly enhanced for building programs with clang against the GNU C Library * Many functions have been added to the vector library for aarch64 * On x86, memset can now use non-temporal stores to improve the performance of large writes * Architectures which use a 32-bit seconds-since-epoch field in struct lastlog, struct utmp, struct utmpx (such as i386, powerpc64le, rv32, rv64, x86-64) switched from a signed to an unsigned type for that field * __rseq_size now denotes the size of the active rseq area (20 bytes initially), not the size of struct rseq (32 bytes initially). - arm-dl-start-user.patch, duplocale-global-locale.patch, elf-parse-tunables.patch, glibc-CVE-2024-33599-nscd-Stack-based-buffer-overflow-in-n.patch, glibc-CVE-2024-33600-nscd-Avoid-null-pointer-crashes-after.patch, glibc-CVE-2024-33600-nscd-Do-not-send-missing-not-found-re.patch, glibc-CVE-2024-33601-CVE-2024-33602-nscd-netgroup-Use-two.patch, iconv-iso-2022-cn-ext.patch, nscd-netgroup-cache-timeout.patch, s390-clone-error-clobber-r7.patch, sigisemptyset.patch, OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=719
129 lines
3.7 KiB
Diff
129 lines
3.7 KiB
Diff
From 2173173d57971d042c0ad4b281431ae127e9b5b8 Mon Sep 17 00:00:00 2001
|
|
From: Andreas Schwab <schwab@suse.de>
|
|
Date: Mon, 11 Mar 2024 15:13:09 +0100
|
|
Subject: [PATCH] linux/sigsetops: fix type confusion (bug 31468)
|
|
|
|
Each mask in the sigset array is an unsigned long, so fix __sigisemptyset
|
|
to use that instead of int. The __sigword function returns a simple array
|
|
index, so it can return int instead of unsigned long.
|
|
---
|
|
signal/tst-sigisemptyset.c | 11 +++++++++++
|
|
sysdeps/unix/sysv/linux/internal-sigset.h | 8 ++++----
|
|
sysdeps/unix/sysv/linux/sigsetops.h | 10 +++++-----
|
|
3 files changed, 20 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/signal/tst-sigisemptyset.c b/signal/tst-sigisemptyset.c
|
|
index f5e35e8c22..11e7f39d09 100644
|
|
--- a/signal/tst-sigisemptyset.c
|
|
+++ b/signal/tst-sigisemptyset.c
|
|
@@ -89,6 +89,17 @@ do_test (void)
|
|
TEST_COMPARE (sigisemptyset (&set), 1);
|
|
}
|
|
|
|
+ {
|
|
+ sigset_t set;
|
|
+ for (int sig = 1; sig <= NSIG; sig++)
|
|
+ {
|
|
+ sigemptyset (&set);
|
|
+ if (sigaddset (&set, sig) < 0)
|
|
+ continue;
|
|
+ TEST_COMPARE (sigisemptyset (&set), 0);
|
|
+ }
|
|
+ }
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
diff --git a/sysdeps/unix/sysv/linux/internal-sigset.h b/sysdeps/unix/sysv/linux/internal-sigset.h
|
|
index 3c21c3b6d5..5d7020b42d 100644
|
|
--- a/sysdeps/unix/sysv/linux/internal-sigset.h
|
|
+++ b/sysdeps/unix/sysv/linux/internal-sigset.h
|
|
@@ -54,7 +54,7 @@ static inline int
|
|
internal_sigisemptyset (const internal_sigset_t *set)
|
|
{
|
|
int cnt = __NSIG_WORDS;
|
|
- int ret = set->__val[--cnt];
|
|
+ unsigned long int ret = set->__val[--cnt];
|
|
while (ret == 0 && --cnt >= 0)
|
|
ret = set->__val[cnt];
|
|
return ret == 0;
|
|
@@ -82,7 +82,7 @@ static inline int
|
|
internal_sigismember (const internal_sigset_t *set, int sig)
|
|
{
|
|
unsigned long int mask = __sigmask (sig);
|
|
- unsigned long int word = __sigword (sig);
|
|
+ int word = __sigword (sig);
|
|
return set->__val[word] & mask ? 1 : 0;
|
|
}
|
|
|
|
@@ -90,7 +90,7 @@ static inline void
|
|
internal_sigaddset (internal_sigset_t *set, int sig)
|
|
{
|
|
unsigned long int mask = __sigmask (sig);
|
|
- unsigned long int word = __sigword (sig);
|
|
+ int word = __sigword (sig);
|
|
set->__val[word] |= mask;
|
|
}
|
|
|
|
@@ -98,7 +98,7 @@ static inline void
|
|
internal_sigdelset (internal_sigset_t *set, int sig)
|
|
{
|
|
unsigned long int mask = __sigmask (sig);
|
|
- unsigned long int word = __sigword (sig);
|
|
+ int word = __sigword (sig);
|
|
set->__val[word] &= ~mask;
|
|
}
|
|
|
|
diff --git a/sysdeps/unix/sysv/linux/sigsetops.h b/sysdeps/unix/sysv/linux/sigsetops.h
|
|
index abd5576172..33db4f77b8 100644
|
|
--- a/sysdeps/unix/sysv/linux/sigsetops.h
|
|
+++ b/sysdeps/unix/sysv/linux/sigsetops.h
|
|
@@ -28,7 +28,7 @@
|
|
(1UL << (((sig) - 1) % ULONG_WIDTH))
|
|
|
|
/* Return the word index for SIG. */
|
|
-static inline unsigned long int
|
|
+static inline int
|
|
__sigword (int sig)
|
|
{
|
|
return (sig - 1) / ULONG_WIDTH;
|
|
@@ -66,7 +66,7 @@ static inline int
|
|
__sigisemptyset (const sigset_t *set)
|
|
{
|
|
int cnt = __NSIG_WORDS;
|
|
- int ret = set->__val[--cnt];
|
|
+ unsigned long int ret = set->__val[--cnt];
|
|
while (ret == 0 && --cnt >= 0)
|
|
ret = set->__val[cnt];
|
|
return ret == 0;
|
|
@@ -92,7 +92,7 @@ static inline int
|
|
__sigismember (const sigset_t *set, int sig)
|
|
{
|
|
unsigned long int mask = __sigmask (sig);
|
|
- unsigned long int word = __sigword (sig);
|
|
+ int word = __sigword (sig);
|
|
return set->__val[word] & mask ? 1 : 0;
|
|
}
|
|
|
|
@@ -100,7 +100,7 @@ static inline void
|
|
__sigaddset (sigset_t *set, int sig)
|
|
{
|
|
unsigned long int mask = __sigmask (sig);
|
|
- unsigned long int word = __sigword (sig);
|
|
+ int word = __sigword (sig);
|
|
set->__val[word] |= mask;
|
|
}
|
|
|
|
@@ -108,7 +108,7 @@ static inline void
|
|
__sigdelset (sigset_t *set, int sig)
|
|
{
|
|
unsigned long int mask = __sigmask (sig);
|
|
- unsigned long int word = __sigword (sig);
|
|
+ int word = __sigword (sig);
|
|
set->__val[word] &= ~mask;
|
|
}
|
|
|
|
--
|
|
2.44.0
|
|
|