forked from pool/glibc
Compare commits
26 Commits
Author | SHA256 | Date | |
---|---|---|---|
0f02b9038e | |||
9c1c2b081c | |||
5bd8466551 | |||
27334820a5 | |||
3127b0cbf2 | |||
6d9b33432f | |||
c83b499904 | |||
6221b919c5 | |||
c7778fe3e4 | |||
239a3794f8 | |||
4a1755eb7b | |||
502561a1bc | |||
2944293d8d | |||
3e4496ae49 | |||
a9219ffbc4 | |||
65696cf8bf | |||
b8816f2fbf | |||
d4ecb2ad0f | |||
23b7c8f1e6 | |||
b1148a59be | |||
5b59e136b2 | |||
7c5fa00607 | |||
7cf128760d | |||
38c25e64ac | |||
2b44d049a5 | |||
fb6d67127b |
@@ -3,6 +3,8 @@
|
|||||||
<package>utils</package>
|
<package>utils</package>
|
||||||
<package>testsuite</package>
|
<package>testsuite</package>
|
||||||
<package>cross-aarch64</package>
|
<package>cross-aarch64</package>
|
||||||
|
<package>cross-hppa</package>
|
||||||
|
<package>cross-loongarch64</package>
|
||||||
<package>cross-ppc64le</package>
|
<package>cross-ppc64le</package>
|
||||||
<package>cross-riscv64</package>
|
<package>cross-riscv64</package>
|
||||||
<package>cross-s390x</package>
|
<package>cross-s390x</package>
|
||||||
|
@@ -1,40 +0,0 @@
|
|||||||
From 63295e4fda1f6dab4bf7442706fe303bf283036c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
|
||||||
Date: Mon, 5 Feb 2024 16:10:24 +0000
|
|
||||||
Subject: [PATCH] arm: Remove wrong ldr from _dl_start_user (BZ 31339)
|
|
||||||
|
|
||||||
The commit 49d877a80b29d3002887b084eec6676d9f5fec18 (arm: Remove
|
|
||||||
_dl_skip_args usage) removed the _SKIP_ARGS literal, which was
|
|
||||||
previously loader to r4 on loader _start. However, the cleanup did not
|
|
||||||
remove the following 'ldr r4, [sl, r4]' on _dl_start_user, used to check
|
|
||||||
to skip the arguments after ld self-relocations.
|
|
||||||
|
|
||||||
In my testing, the kernel initially set r4 to 0, which makes the
|
|
||||||
ldr instruction just read the _GLOBAL_OFFSET_TABLE_. However, since r4
|
|
||||||
is a callee-saved register; a different runtime might not zero
|
|
||||||
initialize it and thus trigger an invalid memory access.
|
|
||||||
|
|
||||||
Checked on arm-linux-gnu.
|
|
||||||
|
|
||||||
Reported-by: Adrian Ratiu <adrian.ratiu@collabora.com>
|
|
||||||
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
|
|
||||||
(cherry picked from commit 1e25112dc0cb2515d27d8d178b1ecce778a9d37a)
|
|
||||||
---
|
|
||||||
sysdeps/arm/dl-machine.h | 1 -
|
|
||||||
1 file changed, 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
|
|
||||||
index b857bbc868..dd1a0f6b6e 100644
|
|
||||||
--- a/sysdeps/arm/dl-machine.h
|
|
||||||
+++ b/sysdeps/arm/dl-machine.h
|
|
||||||
@@ -139,7 +139,6 @@ _start:\n\
|
|
||||||
_dl_start_user:\n\
|
|
||||||
adr r6, .L_GET_GOT\n\
|
|
||||||
add sl, sl, r6\n\
|
|
||||||
- ldr r4, [sl, r4]\n\
|
|
||||||
@ save the entry point in another register\n\
|
|
||||||
mov r6, r0\n\
|
|
||||||
@ get the original arg count\n\
|
|
||||||
--
|
|
||||||
2.43.0
|
|
||||||
|
|
@@ -1,57 +0,0 @@
|
|||||||
From 513331b788a3fa633f1d0417d43915e16a0c88f0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andreas Schwab <schwab@suse.de>
|
|
||||||
Date: Wed, 6 Mar 2024 12:59:47 +0100
|
|
||||||
Subject: [PATCH] duplocale: protect use of global locale (bug 23970)
|
|
||||||
|
|
||||||
Protect the global locale from being modified while we compute the size of
|
|
||||||
the locale category names. That allows the use of the global locale in a
|
|
||||||
single thread, while all other threads use the thread safe locale
|
|
||||||
functions.
|
|
||||||
---
|
|
||||||
locale/duplocale.c | 14 ++++++++------
|
|
||||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/locale/duplocale.c b/locale/duplocale.c
|
|
||||||
index a755ac5c36..bad476700f 100644
|
|
||||||
--- a/locale/duplocale.c
|
|
||||||
+++ b/locale/duplocale.c
|
|
||||||
@@ -43,6 +43,11 @@ __duplocale (locale_t dataset)
|
|
||||||
int cnt;
|
|
||||||
size_t names_len = 0;
|
|
||||||
|
|
||||||
+ /* If dataset points to _nl_global_locale, we need to prevent other
|
|
||||||
+ threads from modifying it. We also modify global data below (the
|
|
||||||
+ usage counts). */
|
|
||||||
+ __libc_rwlock_wrlock (__libc_setlocale_lock);
|
|
||||||
+
|
|
||||||
/* Calculate the total space we need to store all the names. */
|
|
||||||
for (cnt = 0; cnt < __LC_LAST; ++cnt)
|
|
||||||
if (cnt != LC_ALL && dataset->__names[cnt] != _nl_C_name)
|
|
||||||
@@ -55,9 +60,6 @@ __duplocale (locale_t dataset)
|
|
||||||
{
|
|
||||||
char *namep = (char *) (result + 1);
|
|
||||||
|
|
||||||
- /* We modify global data (the usage counts). */
|
|
||||||
- __libc_rwlock_wrlock (__libc_setlocale_lock);
|
|
||||||
-
|
|
||||||
for (cnt = 0; cnt < __LC_LAST; ++cnt)
|
|
||||||
if (cnt != LC_ALL)
|
|
||||||
{
|
|
||||||
@@ -78,11 +80,11 @@ __duplocale (locale_t dataset)
|
|
||||||
result->__ctype_b = dataset->__ctype_b;
|
|
||||||
result->__ctype_tolower = dataset->__ctype_tolower;
|
|
||||||
result->__ctype_toupper = dataset->__ctype_toupper;
|
|
||||||
-
|
|
||||||
- /* It's done. */
|
|
||||||
- __libc_rwlock_unlock (__libc_setlocale_lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* It's done. */
|
|
||||||
+ __libc_rwlock_unlock (__libc_setlocale_lock);
|
|
||||||
+
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
weak_alias (__duplocale, duplocale)
|
|
||||||
--
|
|
||||||
2.44.0
|
|
||||||
|
|
@@ -1,215 +0,0 @@
|
|||||||
From 71149c2a2e85a8233631cc816030d449f021bb2a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
|
||||||
Date: Mon, 6 May 2024 13:18:45 -0300
|
|
||||||
Subject: [PATCH] elf: Only process multiple tunable once (BZ 31686)
|
|
||||||
|
|
||||||
The 680c597e9c3 commit made loader reject ill-formatted strings by
|
|
||||||
first tracking all set tunables and then applying them. However, it does
|
|
||||||
not take into consideration if the same tunable is set multiple times,
|
|
||||||
where parse_tunables_string appends the found tunable without checking
|
|
||||||
if it was already in the list. It leads to a stack-based buffer overflow
|
|
||||||
if the tunable is specified more than the total number of tunables. For
|
|
||||||
instance:
|
|
||||||
|
|
||||||
GLIBC_TUNABLES=glibc.malloc.check=2:... (repeat over the number of
|
|
||||||
total support for different tunable).
|
|
||||||
|
|
||||||
Instead, use the index of the tunable list to get the expected tunable
|
|
||||||
entry. Since now the initial list is zero-initialized, the compiler
|
|
||||||
might emit an extra memset and this requires some minor adjustment
|
|
||||||
on some ports.
|
|
||||||
|
|
||||||
Checked on x86_64-linux-gnu and aarch64-linux-gnu.
|
|
||||||
|
|
||||||
Reported-by: Yuto Maeda <maeda@cyberdefense.jp>
|
|
||||||
Reported-by: Yutaro Shimizu <shimizu@cyberdefense.jp>
|
|
||||||
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
|
|
||||||
(cherry picked from commit bcae44ea8536b30a7119c0986ff5692bddacb672)
|
|
||||||
---
|
|
||||||
elf/dl-tunables.c | 28 ++++++----
|
|
||||||
elf/tst-tunables.c | 61 +++++++++++++++++++++-
|
|
||||||
sysdeps/aarch64/multiarch/memset_generic.S | 4 ++
|
|
||||||
sysdeps/sparc/sparc64/rtld-memset.c | 3 ++
|
|
||||||
4 files changed, 84 insertions(+), 12 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c
|
|
||||||
index 03e1a68675..614ac9c047 100644
|
|
||||||
--- a/elf/dl-tunables.c
|
|
||||||
+++ b/elf/dl-tunables.c
|
|
||||||
@@ -32,6 +32,7 @@
|
|
||||||
#include <ldsodefs.h>
|
|
||||||
#include <array_length.h>
|
|
||||||
#include <dl-minimal-malloc.h>
|
|
||||||
+#include <dl-symbol-redir-ifunc.h>
|
|
||||||
|
|
||||||
#define TUNABLES_INTERNAL 1
|
|
||||||
#include "dl-tunables.h"
|
|
||||||
@@ -223,6 +224,7 @@ parse_tunables_string (const char *valstring, struct tunable_toset_t *tunables)
|
|
||||||
{
|
|
||||||
tunables[ntunables++] =
|
|
||||||
(struct tunable_toset_t) { cur, value, p - value };
|
|
||||||
+
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -234,23 +236,27 @@ parse_tunables_string (const char *valstring, struct tunable_toset_t *tunables)
|
|
||||||
static void
|
|
||||||
parse_tunables (const char *valstring)
|
|
||||||
{
|
|
||||||
- struct tunable_toset_t tunables[tunables_list_size];
|
|
||||||
- int ntunables = parse_tunables_string (valstring, tunables);
|
|
||||||
- if (ntunables == -1)
|
|
||||||
+ struct tunable_toset_t tunables[tunables_list_size] = { 0 };
|
|
||||||
+ if (parse_tunables_string (valstring, tunables) == -1)
|
|
||||||
{
|
|
||||||
_dl_error_printf (
|
|
||||||
"WARNING: ld.so: invalid GLIBC_TUNABLES `%s': ignored.\n", valstring);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
- for (int i = 0; i < ntunables; i++)
|
|
||||||
- if (!tunable_initialize (tunables[i].t, tunables[i].value,
|
|
||||||
- tunables[i].len))
|
|
||||||
- _dl_error_printf ("WARNING: ld.so: invalid GLIBC_TUNABLES value `%.*s' "
|
|
||||||
- "for option `%s': ignored.\n",
|
|
||||||
- (int) tunables[i].len,
|
|
||||||
- tunables[i].value,
|
|
||||||
- tunables[i].t->name);
|
|
||||||
+ for (int i = 0; i < tunables_list_size; i++)
|
|
||||||
+ {
|
|
||||||
+ if (tunables[i].t == NULL)
|
|
||||||
+ continue;
|
|
||||||
+
|
|
||||||
+ if (!tunable_initialize (tunables[i].t, tunables[i].value,
|
|
||||||
+ tunables[i].len))
|
|
||||||
+ _dl_error_printf ("WARNING: ld.so: invalid GLIBC_TUNABLES value `%.*s' "
|
|
||||||
+ "for option `%s': ignored.\n",
|
|
||||||
+ (int) tunables[i].len,
|
|
||||||
+ tunables[i].value,
|
|
||||||
+ tunables[i].t->name);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Initialize the tunables list from the environment. For now we only use the
|
|
||||||
diff --git a/elf/tst-tunables.c b/elf/tst-tunables.c
|
|
||||||
index 095b5c81d9..dff34ed748 100644
|
|
||||||
--- a/elf/tst-tunables.c
|
|
||||||
+++ b/elf/tst-tunables.c
|
|
||||||
@@ -17,6 +17,10 @@
|
|
||||||
<https://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <array_length.h>
|
|
||||||
+/* The test uses the tunable_list size, which is only exported for
|
|
||||||
+ ld.so. This will result in a copy of tunable_list, which is ununsed by
|
|
||||||
+ the test itself. */
|
|
||||||
+#define TUNABLES_INTERNAL 1
|
|
||||||
#include <dl-tunables.h>
|
|
||||||
#include <getopt.h>
|
|
||||||
#include <intprops.h>
|
|
||||||
@@ -24,12 +28,13 @@
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <support/capture_subprocess.h>
|
|
||||||
#include <support/check.h>
|
|
||||||
+#include <support/support.h>
|
|
||||||
|
|
||||||
static int restart;
|
|
||||||
#define CMDLINE_OPTIONS \
|
|
||||||
{ "restart", no_argument, &restart, 1 },
|
|
||||||
|
|
||||||
-static const struct test_t
|
|
||||||
+static struct test_t
|
|
||||||
{
|
|
||||||
const char *name;
|
|
||||||
const char *value;
|
|
||||||
@@ -284,6 +289,29 @@ static const struct test_t
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
},
|
|
||||||
+ /* Also check for repeated tunables with a count larger than the total number
|
|
||||||
+ of tunables. */
|
|
||||||
+ {
|
|
||||||
+ "GLIBC_TUNABLES",
|
|
||||||
+ NULL,
|
|
||||||
+ 2,
|
|
||||||
+ 0,
|
|
||||||
+ 0,
|
|
||||||
+ },
|
|
||||||
+ {
|
|
||||||
+ "GLIBC_TUNABLES",
|
|
||||||
+ NULL,
|
|
||||||
+ 1,
|
|
||||||
+ 0,
|
|
||||||
+ 0,
|
|
||||||
+ },
|
|
||||||
+ {
|
|
||||||
+ "GLIBC_TUNABLES",
|
|
||||||
+ NULL,
|
|
||||||
+ 0,
|
|
||||||
+ 0,
|
|
||||||
+ 0,
|
|
||||||
+ },
|
|
||||||
};
|
|
||||||
|
|
||||||
static int
|
|
||||||
@@ -327,6 +355,37 @@ do_test (int argc, char *argv[])
|
|
||||||
spargv[i] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* Create a tunable line with the duplicate values with a total number
|
|
||||||
+ larger than the different number of tunables. */
|
|
||||||
+ {
|
|
||||||
+ enum { tunables_list_size = array_length (tunable_list) };
|
|
||||||
+ const char *value = "";
|
|
||||||
+ for (int i = 0; i < tunables_list_size; i++)
|
|
||||||
+ value = xasprintf ("%sglibc.malloc.check=2%c",
|
|
||||||
+ value,
|
|
||||||
+ i == (tunables_list_size - 1) ? '\0' : ':');
|
|
||||||
+ tests[33].value = value;
|
|
||||||
+ }
|
|
||||||
+ /* Same as before, but the last tunable values is differen than the
|
|
||||||
+ rest. */
|
|
||||||
+ {
|
|
||||||
+ enum { tunables_list_size = array_length (tunable_list) };
|
|
||||||
+ const char *value = "";
|
|
||||||
+ for (int i = 0; i < tunables_list_size - 1; i++)
|
|
||||||
+ value = xasprintf ("%sglibc.malloc.check=2:", value);
|
|
||||||
+ value = xasprintf ("%sglibc.malloc.check=1", value);
|
|
||||||
+ tests[34].value = value;
|
|
||||||
+ }
|
|
||||||
+ /* Same as before, but with an invalid last entry. */
|
|
||||||
+ {
|
|
||||||
+ enum { tunables_list_size = array_length (tunable_list) };
|
|
||||||
+ const char *value = "";
|
|
||||||
+ for (int i = 0; i < tunables_list_size - 1; i++)
|
|
||||||
+ value = xasprintf ("%sglibc.malloc.check=2:", value);
|
|
||||||
+ value = xasprintf ("%sglibc.malloc.check=1=1", value);
|
|
||||||
+ tests[35].value = value;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
for (int i = 0; i < array_length (tests); i++)
|
|
||||||
{
|
|
||||||
snprintf (nteststr, sizeof nteststr, "%d", i);
|
|
||||||
diff --git a/sysdeps/aarch64/multiarch/memset_generic.S b/sysdeps/aarch64/multiarch/memset_generic.S
|
|
||||||
index 81748bdbce..e125a5ed85 100644
|
|
||||||
--- a/sysdeps/aarch64/multiarch/memset_generic.S
|
|
||||||
+++ b/sysdeps/aarch64/multiarch/memset_generic.S
|
|
||||||
@@ -33,3 +33,7 @@
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <../memset.S>
|
|
||||||
+
|
|
||||||
+#if IS_IN (rtld)
|
|
||||||
+strong_alias (memset, __memset_generic)
|
|
||||||
+#endif
|
|
||||||
diff --git a/sysdeps/sparc/sparc64/rtld-memset.c b/sysdeps/sparc/sparc64/rtld-memset.c
|
|
||||||
index 55f3835790..a19202a620 100644
|
|
||||||
--- a/sysdeps/sparc/sparc64/rtld-memset.c
|
|
||||||
+++ b/sysdeps/sparc/sparc64/rtld-memset.c
|
|
||||||
@@ -1 +1,4 @@
|
|
||||||
#include <string/memset.c>
|
|
||||||
+#if IS_IN(rtld)
|
|
||||||
+strong_alias (memset, __memset_ultra1)
|
|
||||||
+#endif
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
48
float128-sycl.patch
Normal file
48
float128-sycl.patch
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
From a900dbaf70f0a957f56b52caa69173592ad7596e Mon Sep 17 00:00:00 2001
|
||||||
|
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||||
|
Date: Thu, 20 Feb 2025 07:08:26 +0800
|
||||||
|
Subject: [PATCH] x86 (__HAVE_FLOAT128): Defined to 0 for Intel SYCL compiler
|
||||||
|
[BZ #32723]
|
||||||
|
|
||||||
|
Intel compiler always defines __INTEL_LLVM_COMPILER. When SYCL is
|
||||||
|
enabled by -fsycl, it also defines SYCL_LANGUAGE_VERSION. Since Intel
|
||||||
|
SYCL compiler doesn't support _Float128:
|
||||||
|
|
||||||
|
https://github.com/intel/llvm/issues/16903
|
||||||
|
|
||||||
|
define __HAVE_FLOAT128 to 0 for Intel SYCL compiler.
|
||||||
|
|
||||||
|
This fixes BZ #32723.
|
||||||
|
|
||||||
|
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
||||||
|
Reviewed-by: Sam James <sam@gentoo.org>
|
||||||
|
(cherry picked from commit 5a4573be6f96ff49111bb6cae767676b5aafa7a8)
|
||||||
|
---
|
||||||
|
sysdeps/x86/bits/floatn.h | 8 ++++++--
|
||||||
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/sysdeps/x86/bits/floatn.h b/sysdeps/x86/bits/floatn.h
|
||||||
|
index d197cb10dd..adc7ed2e9e 100644
|
||||||
|
--- a/sysdeps/x86/bits/floatn.h
|
||||||
|
+++ b/sysdeps/x86/bits/floatn.h
|
||||||
|
@@ -25,11 +25,15 @@
|
||||||
|
floating-point type with the IEEE 754 binary128 format, and this
|
||||||
|
glibc includes corresponding *f128 interfaces for it. The required
|
||||||
|
libgcc support was added some time after the basic compiler
|
||||||
|
- support, for x86_64 and x86. */
|
||||||
|
+ support, for x86_64 and x86. Intel SYCL compiler doesn't support
|
||||||
|
+ _Float128: https://github.com/intel/llvm/issues/16903
|
||||||
|
+ */
|
||||||
|
#if (defined __x86_64__ \
|
||||||
|
? __GNUC_PREREQ (4, 3) \
|
||||||
|
: (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) \
|
||||||
|
- || __glibc_clang_prereq (3, 4)
|
||||||
|
+ || (__glibc_clang_prereq (3, 4) \
|
||||||
|
+ && (!defined __INTEL_LLVM_COMPILER \
|
||||||
|
+ || !defined SYCL_LANGUAGE_VERSION))
|
||||||
|
# define __HAVE_FLOAT128 1
|
||||||
|
#else
|
||||||
|
# define __HAVE_FLOAT128 0
|
||||||
|
--
|
||||||
|
2.48.1
|
||||||
|
|
@@ -1,54 +0,0 @@
|
|||||||
Index: glibc-2.38/debug/strcpy_chk.c
|
|
||||||
===================================================================
|
|
||||||
--- glibc-2.38.orig/debug/strcpy_chk.c
|
|
||||||
+++ glibc-2.38/debug/strcpy_chk.c
|
|
||||||
@@ -31,3 +31,4 @@ __strcpy_chk (char *dest, const char *sr
|
|
||||||
|
|
||||||
return memcpy (dest, src, len + 1);
|
|
||||||
}
|
|
||||||
+libc_hidden_builtin_def (__strcpy_chk)
|
|
||||||
Index: glibc-2.38/include/string.h
|
|
||||||
===================================================================
|
|
||||||
--- glibc-2.38.orig/include/string.h
|
|
||||||
+++ glibc-2.38/include/string.h
|
|
||||||
@@ -213,6 +213,7 @@ libc_hidden_builtin_proto (__memcpy_chk)
|
|
||||||
libc_hidden_builtin_proto (__memmove_chk)
|
|
||||||
libc_hidden_builtin_proto (__mempcpy_chk)
|
|
||||||
libc_hidden_builtin_proto (__memset_chk)
|
|
||||||
+libc_hidden_builtin_proto (__strcpy_chk)
|
|
||||||
libc_hidden_builtin_proto (__stpcpy_chk)
|
|
||||||
libc_hidden_builtin_proto (__strncpy_chk)
|
|
||||||
|
|
||||||
Index: glibc-2.38/intl/loadmsgcat.c
|
|
||||||
===================================================================
|
|
||||||
--- glibc-2.38.orig/intl/loadmsgcat.c
|
|
||||||
+++ glibc-2.38/intl/loadmsgcat.c
|
|
||||||
@@ -796,8 +796,26 @@ _nl_load_domain (struct loaded_l10nfile
|
|
||||||
if (domain_file->filename == NULL)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
- /* Try to open the addressed file. */
|
|
||||||
- fd = open (domain_file->filename, O_RDONLY | O_BINARY);
|
|
||||||
+ /* Replace /locale/ with /usr/share/locale-langpack/ */
|
|
||||||
+ const char *langpackdir = "/usr/share/locale-langpack/";
|
|
||||||
+ char *filename_langpack = malloc (strlen (domain_file->filename)
|
|
||||||
+ + strlen (langpackdir));
|
|
||||||
+ if (filename_langpack != NULL)
|
|
||||||
+ {
|
|
||||||
+ char *p = strstr (domain_file->filename, "/locale/");
|
|
||||||
+ if (p != NULL)
|
|
||||||
+ {
|
|
||||||
+ strcpy (__stpcpy (filename_langpack, langpackdir), p + 8);
|
|
||||||
+ fd = open (filename_langpack, O_RDONLY | O_BINARY);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ free (filename_langpack);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (fd == -1)
|
|
||||||
+ /* Try to open the addressed file. */
|
|
||||||
+ fd = open (domain_file->filename, O_RDONLY | O_BINARY);
|
|
||||||
+
|
|
||||||
if (fd == -1)
|
|
||||||
goto out;
|
|
||||||
|
|
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:f77bd47cf8170c57365ae7bf86696c118adb3b120d3259c64c502d3dc1e2d926
|
|
||||||
size 18520988
|
|
@@ -1,16 +0,0 @@
|
|||||||
-----BEGIN PGP SIGNATURE-----
|
|
||||||
|
|
||||||
iQIzBAABCAAdFiEEcnNUKzmWLfeymZMUFnkrTqJTQPgFAmW6xDIACgkQFnkrTqJT
|
|
||||||
QPgAAg/9FnW6kXC3eth/BhuzaEEjOmy8BiTSrEHVLWz9veRTuBBYavxH/XUKfLrg
|
|
||||||
dAFMnASU4DtDUFI2kFWGJIDLk8E/rUau8a0f5Skh4W3VSrc7MDvQhMMt1HggRIqE
|
|
||||||
O2G7fS6uKZokZElcvEKYrTnq7iwH25K1lvXUKAeaUnVQg6upGYnCe8vuZutuZR9x
|
|
||||||
OFkewctLM8Canc6wvW0V92Oy+6eZsDq08HCJenFklSh1wz9+MUzyivkv/b6fXK6E
|
|
||||||
lKGLxpPH7vzfKao6YJBrAHT5raFxdz3yUGzevfeBE9S8UrOYHhsoBRZsaQUWkyKU
|
|
||||||
A3Gn1ioTkxj8szfgHCrweN6A4Y4MlGgMeQbplQnrjQEfUTVo9N2zkQwWRsM4VGeF
|
|
||||||
RkbWwpIQg6zMi3BFfizHqAZZWjjWb0wu6mDWmnQBaQ97dN0DAuKJ7cDNmLe6+vOE
|
|
||||||
OkXRTses8Ta3npAxKjrWNm6WjcrYAzEYLGUT6hLBmZj+WulHmRDPEyuo8H3eihuL
|
|
||||||
JzJXc7X6O3HntgCqqGrC4yNGtjRF0r3FjZ9Zrv6snEzWHVBnDw/9C5Ss9aZ+VSxO
|
|
||||||
Uqo0nESWKHtz9UBS73yA/H1k1rMnQS9yeugMoqBil+cJD5xMZETNKFbUGwR8feQ4
|
|
||||||
O6w8uH1q70ZwtTVf3l6sbijMeORfcrS0WEErxm8IREmUbqPIMRw=
|
|
||||||
=uGia
|
|
||||||
-----END PGP SIGNATURE-----
|
|
3
glibc-2.41.tar.xz
Normal file
3
glibc-2.41.tar.xz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:a5a26b22f545d6b7d7b3dd828e11e428f24f4fac43c934fb071b6a7d0828e901
|
||||||
|
size 19344868
|
19
glibc-2.41.tar.xz.sig
Normal file
19
glibc-2.41.tar.xz.sig
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
-----BEGIN PGP SIGNATURE-----
|
||||||
|
Version: GnuPG v2
|
||||||
|
|
||||||
|
iQKTBAABCgB9FiEE/Rnm0xsZLuTcY+rT3CsWIV7VQSoFAmea1xNfFIAAAAAALgAo
|
||||||
|
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEZE
|
||||||
|
MTlFNkQzMUIxOTJFRTREQzYzRUFEM0RDMkIxNjIxNUVENTQxMkEACgkQ3CsWIV7V
|
||||||
|
QSq+Qg//VwaVsRXRHVHHAbbFyqjeYPQfkgIwzOfbrkVEe75L+PnVBF52cRJ8S2YK
|
||||||
|
FopiiK+xBmS6rUyuzhOVtLSpGepPtOHJI5NzWz2radZmoRhW8ozoFL7iGmJxIYoX
|
||||||
|
wz6zadwJeg5AFMY3VFNTAtkxRIn7zk25x6LYMj7cIF1dxoh6NbiGGq/5z5Ru+9l0
|
||||||
|
zX1x1wPfDNqgjW0pZyZ4xt1O853EZjmY1kvsLrrHk+ruq3TGcEUjUlmw3F9LKwny
|
||||||
|
H9GYwNIfcbnuK7ZDh2cIqxBVd/T8e1Eam+tyVlSaijIHptsF59roBvP3kFAdkDp9
|
||||||
|
byHnmR8c/5M5KFFdOgURl17ST9yNyOEgMgzrknqk9Onfd24DBz2c/rv93IjrBNpy
|
||||||
|
Tllw0yGgVElyKeXVSGDm6DOHJT50LB/ra2Pb82zf33rs5prw1yLL7VZ3Y58ysUJq
|
||||||
|
fi7IGWEFK8uhxT/15jIyp19x2RpQvHJqVIpNQmx/SLbGCuh4lS+1poIng3M5ktMX
|
||||||
|
R4KviCHrPGWCLQIveqffHiBr6kbKOmZL9NSYFI+o1aINL0pToqT9jw7gA4brYnzn
|
||||||
|
9Uu9xN4YkSqCXWBXdJCj2rDJDVqOWarUaC7/datpFkdC/hCeN63CQ+cTj166CpdZ
|
||||||
|
Cyqcai2WeyNJvcoLY3G5J/6BDBzVP78Ze42Ki/IsSo3YDK3NFGg=
|
||||||
|
=KfhY
|
||||||
|
-----END PGP SIGNATURE-----
|
@@ -1,38 +0,0 @@
|
|||||||
From 1263d583d2e28afb8be53f8d6922f0842036f35d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Florian Weimer <fweimer@redhat.com>
|
|
||||||
Date: Thu, 25 Apr 2024 15:00:45 +0200
|
|
||||||
Subject: [PATCH] CVE-2024-33599: nscd: Stack-based buffer overflow in netgroup
|
|
||||||
cache (bug 31677)
|
|
||||||
|
|
||||||
Using alloca matches what other caches do. The request length is
|
|
||||||
bounded by MAXKEYLEN.
|
|
||||||
|
|
||||||
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
|
|
||||||
(cherry picked from commit 87801a8fd06db1d654eea3e4f7626ff476a9bdaa)
|
|
||||||
---
|
|
||||||
nscd/netgroupcache.c | 5 +++--
|
|
||||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c
|
|
||||||
index 0c6e46f15c..f227dc7fa2 100644
|
|
||||||
--- a/nscd/netgroupcache.c
|
|
||||||
+++ b/nscd/netgroupcache.c
|
|
||||||
@@ -502,12 +502,13 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
= (struct indataset *) mempool_alloc (db,
|
|
||||||
sizeof (*dataset) + req->key_len,
|
|
||||||
1);
|
|
||||||
- struct indataset dataset_mem;
|
|
||||||
bool cacheable = true;
|
|
||||||
if (__glibc_unlikely (dataset == NULL))
|
|
||||||
{
|
|
||||||
cacheable = false;
|
|
||||||
- dataset = &dataset_mem;
|
|
||||||
+ /* The alloca is safe because nscd_run_worker verfies that
|
|
||||||
+ key_len is not larger than MAXKEYLEN. */
|
|
||||||
+ dataset = alloca (sizeof (*dataset) + req->key_len);
|
|
||||||
}
|
|
||||||
|
|
||||||
datahead_init_pos (&dataset->head, sizeof (*dataset) + req->key_len,
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
@@ -1,60 +0,0 @@
|
|||||||
From c99f886de54446cd4447db6b44be93dabbdc2f8b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Florian Weimer <fweimer@redhat.com>
|
|
||||||
Date: Thu, 25 Apr 2024 15:01:07 +0200
|
|
||||||
Subject: [PATCH] CVE-2024-33600: nscd: Avoid null pointer crashes after
|
|
||||||
notfound response (bug 31678)
|
|
||||||
|
|
||||||
The addgetnetgrentX call in addinnetgrX may have failed to produce
|
|
||||||
a result, so the result variable in addinnetgrX can be NULL.
|
|
||||||
Use db->negtimeout as the fallback value if there is no result data;
|
|
||||||
the timeout is also overwritten below.
|
|
||||||
|
|
||||||
Also avoid sending a second not-found response. (The client
|
|
||||||
disconnects after receiving the first response, so the data stream did
|
|
||||||
not go out of sync even without this fix.) It is still beneficial to
|
|
||||||
add the negative response to the mapping, so that the client can get
|
|
||||||
it from there in the future, instead of going through the socket.
|
|
||||||
|
|
||||||
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
|
|
||||||
(cherry picked from commit b048a482f088e53144d26a61c390bed0210f49f2)
|
|
||||||
---
|
|
||||||
nscd/netgroupcache.c | 11 +++++++----
|
|
||||||
1 file changed, 7 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c
|
|
||||||
index c18fe111f3..e22ffa5884 100644
|
|
||||||
--- a/nscd/netgroupcache.c
|
|
||||||
+++ b/nscd/netgroupcache.c
|
|
||||||
@@ -511,14 +511,15 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
|
|
||||||
datahead_init_pos (&dataset->head, sizeof (*dataset) + req->key_len,
|
|
||||||
sizeof (innetgroup_response_header),
|
|
||||||
- he == NULL ? 0 : dh->nreloads + 1, result->head.ttl);
|
|
||||||
+ he == NULL ? 0 : dh->nreloads + 1,
|
|
||||||
+ result == NULL ? db->negtimeout : result->head.ttl);
|
|
||||||
/* Set the notfound status and timeout based on the result from
|
|
||||||
getnetgrent. */
|
|
||||||
- dataset->head.notfound = result->head.notfound;
|
|
||||||
+ dataset->head.notfound = result == NULL || result->head.notfound;
|
|
||||||
dataset->head.timeout = timeout;
|
|
||||||
|
|
||||||
dataset->resp.version = NSCD_VERSION;
|
|
||||||
- dataset->resp.found = result->resp.found;
|
|
||||||
+ dataset->resp.found = result != NULL && result->resp.found;
|
|
||||||
/* Until we find a matching entry the result is 0. */
|
|
||||||
dataset->resp.result = 0;
|
|
||||||
|
|
||||||
@@ -566,7 +567,9 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (he == NULL)
|
|
||||||
+ /* addgetnetgrentX may have already sent a notfound response. Do
|
|
||||||
+ not send another one. */
|
|
||||||
+ if (he == NULL && dataset->resp.found)
|
|
||||||
{
|
|
||||||
/* We write the dataset before inserting it to the database
|
|
||||||
since while inserting this thread might block and so would
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
@@ -1,59 +0,0 @@
|
|||||||
From 5a508e0b508c8ad53bd0d2fb48fd71b242626341 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Florian Weimer <fweimer@redhat.com>
|
|
||||||
Date: Thu, 25 Apr 2024 15:01:07 +0200
|
|
||||||
Subject: [PATCH] CVE-2024-33600: nscd: Do not send missing not-found response
|
|
||||||
in addgetnetgrentX (bug 31678)
|
|
||||||
|
|
||||||
If we failed to add a not-found response to the cache, the dataset
|
|
||||||
point can be null, resulting in a null pointer dereference.
|
|
||||||
|
|
||||||
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
|
|
||||||
(cherry picked from commit 7835b00dbce53c3c87bbbb1754a95fb5e58187aa)
|
|
||||||
---
|
|
||||||
nscd/netgroupcache.c | 14 ++++++--------
|
|
||||||
1 file changed, 6 insertions(+), 8 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c
|
|
||||||
index f227dc7fa2..c18fe111f3 100644
|
|
||||||
--- a/nscd/netgroupcache.c
|
|
||||||
+++ b/nscd/netgroupcache.c
|
|
||||||
@@ -147,7 +147,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
/* No such service. */
|
|
||||||
cacheable = do_notfound (db, fd, req, key, &dataset, &total, &timeout,
|
|
||||||
&key_copy);
|
|
||||||
- goto writeout;
|
|
||||||
+ goto maybe_cache_add;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset (&data, '\0', sizeof (data));
|
|
||||||
@@ -348,7 +348,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
{
|
|
||||||
cacheable = do_notfound (db, fd, req, key, &dataset, &total, &timeout,
|
|
||||||
&key_copy);
|
|
||||||
- goto writeout;
|
|
||||||
+ goto maybe_cache_add;
|
|
||||||
}
|
|
||||||
|
|
||||||
total = buffilled;
|
|
||||||
@@ -410,14 +410,12 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
}
|
|
||||||
|
|
||||||
if (he == NULL && fd != -1)
|
|
||||||
- {
|
|
||||||
- /* We write the dataset before inserting it to the database
|
|
||||||
- since while inserting this thread might block and so would
|
|
||||||
- unnecessarily let the receiver wait. */
|
|
||||||
- writeout:
|
|
||||||
+ /* We write the dataset before inserting it to the database since
|
|
||||||
+ while inserting this thread might block and so would
|
|
||||||
+ unnecessarily let the receiver wait. */
|
|
||||||
writeall (fd, &dataset->resp, dataset->head.recsize);
|
|
||||||
- }
|
|
||||||
|
|
||||||
+ maybe_cache_add:
|
|
||||||
if (cacheable)
|
|
||||||
{
|
|
||||||
/* If necessary, we also propagate the data to disk. */
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
@@ -1,390 +0,0 @@
|
|||||||
From a9a8d3eebb145779a18d90e3966009a1daa63cd8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Florian Weimer <fweimer@redhat.com>
|
|
||||||
Date: Thu, 25 Apr 2024 15:01:07 +0200
|
|
||||||
Subject: [PATCH] CVE-2024-33601, CVE-2024-33602: nscd: netgroup: Use two
|
|
||||||
buffers in addgetnetgrentX (bug 31680)
|
|
||||||
|
|
||||||
This avoids potential memory corruption when the underlying NSS
|
|
||||||
callback function does not use the buffer space to store all strings
|
|
||||||
(e.g., for constant strings).
|
|
||||||
|
|
||||||
Instead of custom buffer management, two scratch buffers are used.
|
|
||||||
This increases stack usage somewhat.
|
|
||||||
|
|
||||||
Scratch buffer allocation failure is handled by return -1
|
|
||||||
(an invalid timeout value) instead of terminating the process.
|
|
||||||
This fixes bug 31679.
|
|
||||||
|
|
||||||
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
|
|
||||||
(cherry picked from commit c04a21e050d64a1193a6daab872bca2528bda44b)
|
|
||||||
---
|
|
||||||
nscd/netgroupcache.c | 219 ++++++++++++++++++++++++-------------------
|
|
||||||
1 file changed, 121 insertions(+), 98 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c
|
|
||||||
index e22ffa5884..e8fe041846 100644
|
|
||||||
--- a/nscd/netgroupcache.c
|
|
||||||
+++ b/nscd/netgroupcache.c
|
|
||||||
@@ -23,6 +23,7 @@
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/mman.h>
|
|
||||||
+#include <scratch_buffer.h>
|
|
||||||
|
|
||||||
#include "../nss/netgroup.h"
|
|
||||||
#include "nscd.h"
|
|
||||||
@@ -65,6 +66,16 @@ struct dataset
|
|
||||||
char strdata[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
+/* Send a notfound response to FD. Always returns -1 to indicate an
|
|
||||||
+ ephemeral error. */
|
|
||||||
+static time_t
|
|
||||||
+send_notfound (int fd)
|
|
||||||
+{
|
|
||||||
+ if (fd != -1)
|
|
||||||
+ TEMP_FAILURE_RETRY (send (fd, ¬found, sizeof (notfound), MSG_NOSIGNAL));
|
|
||||||
+ return -1;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/* Sends a notfound message and prepares a notfound dataset to write to the
|
|
||||||
cache. Returns true if there was enough memory to allocate the dataset and
|
|
||||||
returns the dataset in DATASETP, total bytes to write in TOTALP and the
|
|
||||||
@@ -83,8 +94,7 @@ do_notfound (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
total = sizeof (notfound);
|
|
||||||
timeout = time (NULL) + db->negtimeout;
|
|
||||||
|
|
||||||
- if (fd != -1)
|
|
||||||
- TEMP_FAILURE_RETRY (send (fd, ¬found, total, MSG_NOSIGNAL));
|
|
||||||
+ send_notfound (fd);
|
|
||||||
|
|
||||||
dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1);
|
|
||||||
/* If we cannot permanently store the result, so be it. */
|
|
||||||
@@ -109,11 +119,78 @@ do_notfound (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
return cacheable;
|
|
||||||
}
|
|
||||||
|
|
||||||
+struct addgetnetgrentX_scratch
|
|
||||||
+{
|
|
||||||
+ /* This is the result that the caller should use. It can be NULL,
|
|
||||||
+ point into buffer, or it can be in the cache. */
|
|
||||||
+ struct dataset *dataset;
|
|
||||||
+
|
|
||||||
+ struct scratch_buffer buffer;
|
|
||||||
+
|
|
||||||
+ /* Used internally in addgetnetgrentX as a staging area. */
|
|
||||||
+ struct scratch_buffer tmp;
|
|
||||||
+
|
|
||||||
+ /* Number of bytes in buffer that are actually used. */
|
|
||||||
+ size_t buffer_used;
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+static void
|
|
||||||
+addgetnetgrentX_scratch_init (struct addgetnetgrentX_scratch *scratch)
|
|
||||||
+{
|
|
||||||
+ scratch->dataset = NULL;
|
|
||||||
+ scratch_buffer_init (&scratch->buffer);
|
|
||||||
+ scratch_buffer_init (&scratch->tmp);
|
|
||||||
+
|
|
||||||
+ /* Reserve space for the header. */
|
|
||||||
+ scratch->buffer_used = sizeof (struct dataset);
|
|
||||||
+ static_assert (sizeof (struct dataset) < sizeof (scratch->tmp.__space),
|
|
||||||
+ "initial buffer space");
|
|
||||||
+ memset (scratch->tmp.data, 0, sizeof (struct dataset));
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static void
|
|
||||||
+addgetnetgrentX_scratch_free (struct addgetnetgrentX_scratch *scratch)
|
|
||||||
+{
|
|
||||||
+ scratch_buffer_free (&scratch->buffer);
|
|
||||||
+ scratch_buffer_free (&scratch->tmp);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/* Copy LENGTH bytes from S into SCRATCH. Returns NULL if SCRATCH
|
|
||||||
+ could not be resized, otherwise a pointer to the copy. */
|
|
||||||
+static char *
|
|
||||||
+addgetnetgrentX_append_n (struct addgetnetgrentX_scratch *scratch,
|
|
||||||
+ const char *s, size_t length)
|
|
||||||
+{
|
|
||||||
+ while (true)
|
|
||||||
+ {
|
|
||||||
+ size_t remaining = scratch->buffer.length - scratch->buffer_used;
|
|
||||||
+ if (remaining >= length)
|
|
||||||
+ break;
|
|
||||||
+ if (!scratch_buffer_grow_preserve (&scratch->buffer))
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+ char *copy = scratch->buffer.data + scratch->buffer_used;
|
|
||||||
+ memcpy (copy, s, length);
|
|
||||||
+ scratch->buffer_used += length;
|
|
||||||
+ return copy;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/* Copy S into SCRATCH, including its null terminator. Returns false
|
|
||||||
+ if SCRATCH could not be resized. */
|
|
||||||
+static bool
|
|
||||||
+addgetnetgrentX_append (struct addgetnetgrentX_scratch *scratch, const char *s)
|
|
||||||
+{
|
|
||||||
+ if (s == NULL)
|
|
||||||
+ s = "";
|
|
||||||
+ return addgetnetgrentX_append_n (scratch, s, strlen (s) + 1) != NULL;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/* Caller must initialize and free *SCRATCH. If the return value is
|
|
||||||
+ negative, this function has sent a notfound response. */
|
|
||||||
static time_t
|
|
||||||
addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
const char *key, uid_t uid, struct hashentry *he,
|
|
||||||
- struct datahead *dh, struct dataset **resultp,
|
|
||||||
- void **tofreep)
|
|
||||||
+ struct datahead *dh, struct addgetnetgrentX_scratch *scratch)
|
|
||||||
{
|
|
||||||
if (__glibc_unlikely (debug_level > 0))
|
|
||||||
{
|
|
||||||
@@ -132,14 +209,10 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
|
|
||||||
char *key_copy = NULL;
|
|
||||||
struct __netgrent data;
|
|
||||||
- size_t buflen = MAX (1024, sizeof (*dataset) + req->key_len);
|
|
||||||
- size_t buffilled = sizeof (*dataset);
|
|
||||||
- char *buffer = NULL;
|
|
||||||
size_t nentries = 0;
|
|
||||||
size_t group_len = strlen (key) + 1;
|
|
||||||
struct name_list *first_needed
|
|
||||||
= alloca (sizeof (struct name_list) + group_len);
|
|
||||||
- *tofreep = NULL;
|
|
||||||
|
|
||||||
if (netgroup_database == NULL
|
|
||||||
&& !__nss_database_get (nss_database_netgroup, &netgroup_database))
|
|
||||||
@@ -151,8 +224,6 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
}
|
|
||||||
|
|
||||||
memset (&data, '\0', sizeof (data));
|
|
||||||
- buffer = xmalloc (buflen);
|
|
||||||
- *tofreep = buffer;
|
|
||||||
first_needed->next = first_needed;
|
|
||||||
memcpy (first_needed->name, key, group_len);
|
|
||||||
data.needed_groups = first_needed;
|
|
||||||
@@ -195,8 +266,8 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
int e;
|
|
||||||
- status = getfct.f (&data, buffer + buffilled,
|
|
||||||
- buflen - buffilled - req->key_len, &e);
|
|
||||||
+ status = getfct.f (&data, scratch->tmp.data,
|
|
||||||
+ scratch->tmp.length, &e);
|
|
||||||
if (status == NSS_STATUS_SUCCESS)
|
|
||||||
{
|
|
||||||
if (data.type == triple_val)
|
|
||||||
@@ -204,68 +275,10 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
const char *nhost = data.val.triple.host;
|
|
||||||
const char *nuser = data.val.triple.user;
|
|
||||||
const char *ndomain = data.val.triple.domain;
|
|
||||||
-
|
|
||||||
- size_t hostlen = strlen (nhost ?: "") + 1;
|
|
||||||
- size_t userlen = strlen (nuser ?: "") + 1;
|
|
||||||
- size_t domainlen = strlen (ndomain ?: "") + 1;
|
|
||||||
-
|
|
||||||
- if (nhost == NULL || nuser == NULL || ndomain == NULL
|
|
||||||
- || nhost > nuser || nuser > ndomain)
|
|
||||||
- {
|
|
||||||
- const char *last = nhost;
|
|
||||||
- if (last == NULL
|
|
||||||
- || (nuser != NULL && nuser > last))
|
|
||||||
- last = nuser;
|
|
||||||
- if (last == NULL
|
|
||||||
- || (ndomain != NULL && ndomain > last))
|
|
||||||
- last = ndomain;
|
|
||||||
-
|
|
||||||
- size_t bufused
|
|
||||||
- = (last == NULL
|
|
||||||
- ? buffilled
|
|
||||||
- : last + strlen (last) + 1 - buffer);
|
|
||||||
-
|
|
||||||
- /* We have to make temporary copies. */
|
|
||||||
- size_t needed = hostlen + userlen + domainlen;
|
|
||||||
-
|
|
||||||
- if (buflen - req->key_len - bufused < needed)
|
|
||||||
- {
|
|
||||||
- buflen += MAX (buflen, 2 * needed);
|
|
||||||
- /* Save offset in the old buffer. We don't
|
|
||||||
- bother with the NULL check here since
|
|
||||||
- we'll do that later anyway. */
|
|
||||||
- size_t nhostdiff = nhost - buffer;
|
|
||||||
- size_t nuserdiff = nuser - buffer;
|
|
||||||
- size_t ndomaindiff = ndomain - buffer;
|
|
||||||
-
|
|
||||||
- char *newbuf = xrealloc (buffer, buflen);
|
|
||||||
- /* Fix up the triplet pointers into the new
|
|
||||||
- buffer. */
|
|
||||||
- nhost = (nhost ? newbuf + nhostdiff
|
|
||||||
- : NULL);
|
|
||||||
- nuser = (nuser ? newbuf + nuserdiff
|
|
||||||
- : NULL);
|
|
||||||
- ndomain = (ndomain ? newbuf + ndomaindiff
|
|
||||||
- : NULL);
|
|
||||||
- *tofreep = buffer = newbuf;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- nhost = memcpy (buffer + bufused,
|
|
||||||
- nhost ?: "", hostlen);
|
|
||||||
- nuser = memcpy ((char *) nhost + hostlen,
|
|
||||||
- nuser ?: "", userlen);
|
|
||||||
- ndomain = memcpy ((char *) nuser + userlen,
|
|
||||||
- ndomain ?: "", domainlen);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- char *wp = buffer + buffilled;
|
|
||||||
- wp = memmove (wp, nhost ?: "", hostlen);
|
|
||||||
- wp += hostlen;
|
|
||||||
- wp = memmove (wp, nuser ?: "", userlen);
|
|
||||||
- wp += userlen;
|
|
||||||
- wp = memmove (wp, ndomain ?: "", domainlen);
|
|
||||||
- wp += domainlen;
|
|
||||||
- buffilled = wp - buffer;
|
|
||||||
+ if (!(addgetnetgrentX_append (scratch, nhost)
|
|
||||||
+ && addgetnetgrentX_append (scratch, nuser)
|
|
||||||
+ && addgetnetgrentX_append (scratch, ndomain)))
|
|
||||||
+ return send_notfound (fd);
|
|
||||||
++nentries;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
@@ -317,8 +330,8 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
}
|
|
||||||
else if (status == NSS_STATUS_TRYAGAIN && e == ERANGE)
|
|
||||||
{
|
|
||||||
- buflen *= 2;
|
|
||||||
- *tofreep = buffer = xrealloc (buffer, buflen);
|
|
||||||
+ if (!scratch_buffer_grow (&scratch->tmp))
|
|
||||||
+ return send_notfound (fd);
|
|
||||||
}
|
|
||||||
else if (status == NSS_STATUS_RETURN
|
|
||||||
|| status == NSS_STATUS_NOTFOUND
|
|
||||||
@@ -351,10 +364,17 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
goto maybe_cache_add;
|
|
||||||
}
|
|
||||||
|
|
||||||
- total = buffilled;
|
|
||||||
+ /* Capture the result size without the key appended. */
|
|
||||||
+ total = scratch->buffer_used;
|
|
||||||
+
|
|
||||||
+ /* Make a copy of the key. The scratch buffer must not move after
|
|
||||||
+ this point. */
|
|
||||||
+ key_copy = addgetnetgrentX_append_n (scratch, key, req->key_len);
|
|
||||||
+ if (key_copy == NULL)
|
|
||||||
+ return send_notfound (fd);
|
|
||||||
|
|
||||||
/* Fill in the dataset. */
|
|
||||||
- dataset = (struct dataset *) buffer;
|
|
||||||
+ dataset = scratch->buffer.data;
|
|
||||||
timeout = datahead_init_pos (&dataset->head, total + req->key_len,
|
|
||||||
total - offsetof (struct dataset, resp),
|
|
||||||
he == NULL ? 0 : dh->nreloads + 1,
|
|
||||||
@@ -363,11 +383,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
dataset->resp.version = NSCD_VERSION;
|
|
||||||
dataset->resp.found = 1;
|
|
||||||
dataset->resp.nresults = nentries;
|
|
||||||
- dataset->resp.result_len = buffilled - sizeof (*dataset);
|
|
||||||
-
|
|
||||||
- assert (buflen - buffilled >= req->key_len);
|
|
||||||
- key_copy = memcpy (buffer + buffilled, key, req->key_len);
|
|
||||||
- buffilled += req->key_len;
|
|
||||||
+ dataset->resp.result_len = total - sizeof (*dataset);
|
|
||||||
|
|
||||||
/* Now we can determine whether on refill we have to create a new
|
|
||||||
record or not. */
|
|
||||||
@@ -398,7 +414,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
if (__glibc_likely (newp != NULL))
|
|
||||||
{
|
|
||||||
/* Adjust pointer into the memory block. */
|
|
||||||
- key_copy = (char *) newp + (key_copy - buffer);
|
|
||||||
+ key_copy = (char *) newp + (key_copy - (char *) dataset);
|
|
||||||
|
|
||||||
dataset = memcpy (newp, dataset, total + req->key_len);
|
|
||||||
cacheable = true;
|
|
||||||
@@ -439,7 +455,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
|
||||||
- *resultp = dataset;
|
|
||||||
+ scratch->dataset = dataset;
|
|
||||||
|
|
||||||
return timeout;
|
|
||||||
}
|
|
||||||
@@ -460,6 +476,9 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
if (user != NULL)
|
|
||||||
key = strchr (key, '\0') + 1;
|
|
||||||
const char *domain = *key++ ? key : NULL;
|
|
||||||
+ struct addgetnetgrentX_scratch scratch;
|
|
||||||
+
|
|
||||||
+ addgetnetgrentX_scratch_init (&scratch);
|
|
||||||
|
|
||||||
if (__glibc_unlikely (debug_level > 0))
|
|
||||||
{
|
|
||||||
@@ -475,12 +494,8 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
group, group_len,
|
|
||||||
db, uid);
|
|
||||||
time_t timeout;
|
|
||||||
- void *tofree;
|
|
||||||
if (result != NULL)
|
|
||||||
- {
|
|
||||||
- timeout = result->head.timeout;
|
|
||||||
- tofree = NULL;
|
|
||||||
- }
|
|
||||||
+ timeout = result->head.timeout;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
request_header req_get =
|
|
||||||
@@ -489,7 +504,10 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
.key_len = group_len
|
|
||||||
};
|
|
||||||
timeout = addgetnetgrentX (db, -1, &req_get, group, uid, NULL, NULL,
|
|
||||||
- &result, &tofree);
|
|
||||||
+ &scratch);
|
|
||||||
+ result = scratch.dataset;
|
|
||||||
+ if (timeout < 0)
|
|
||||||
+ goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct indataset
|
|
||||||
@@ -603,7 +621,7 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
|
||||||
- free (tofree);
|
|
||||||
+ addgetnetgrentX_scratch_free (&scratch);
|
|
||||||
return timeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -613,11 +631,12 @@ addgetnetgrentX_ignore (struct database_dyn *db, int fd, request_header *req,
|
|
||||||
const char *key, uid_t uid, struct hashentry *he,
|
|
||||||
struct datahead *dh)
|
|
||||||
{
|
|
||||||
- struct dataset *ignore;
|
|
||||||
- void *tofree;
|
|
||||||
- time_t timeout = addgetnetgrentX (db, fd, req, key, uid, he, dh,
|
|
||||||
- &ignore, &tofree);
|
|
||||||
- free (tofree);
|
|
||||||
+ struct addgetnetgrentX_scratch scratch;
|
|
||||||
+ addgetnetgrentX_scratch_init (&scratch);
|
|
||||||
+ time_t timeout = addgetnetgrentX (db, fd, req, key, uid, he, dh, &scratch);
|
|
||||||
+ addgetnetgrentX_scratch_free (&scratch);
|
|
||||||
+ if (timeout < 0)
|
|
||||||
+ timeout = 0;
|
|
||||||
return timeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -661,5 +680,9 @@ readdinnetgr (struct database_dyn *db, struct hashentry *he,
|
|
||||||
.key_len = he->len
|
|
||||||
};
|
|
||||||
|
|
||||||
- return addinnetgrX (db, -1, &req, db->data + he->key, he->owner, he, dh);
|
|
||||||
+ int timeout = addinnetgrX (db, -1, &req, db->data + he->key, he->owner,
|
|
||||||
+ he, dh);
|
|
||||||
+ if (timeout < 0)
|
|
||||||
+ timeout = 0;
|
|
||||||
+ return timeout;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
@@ -8,7 +8,7 @@ Index: glibc-2.27/csu/version.c
|
|||||||
static const char banner[] =
|
static const char banner[] =
|
||||||
-"GNU C Library "PKGVERSION RELEASE" release version "VERSION".\n\
|
-"GNU C Library "PKGVERSION RELEASE" release version "VERSION".\n\
|
||||||
+"GNU C Library "PKGVERSION RELEASE" release version "VERSION" (git "GITID").\n\
|
+"GNU C Library "PKGVERSION RELEASE" release version "VERSION" (git "GITID").\n\
|
||||||
Copyright (C) 2024 Free Software Foundation, Inc.\n\
|
Copyright (C) 2025 Free Software Foundation, Inc.\n\
|
||||||
This is free software; see the source for copying conditions.\n\
|
This is free software; see the source for copying conditions.\n\
|
||||||
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
|
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
|
||||||
PARTICULAR PURPOSE.\n\
|
PARTICULAR PURPOSE.\n\
|
||||||
|
207
glibc.changes
207
glibc.changes
@@ -1,16 +1,216 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jun 17 09:11:26 UTC 2025 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- ppc64le-revert-power10-strcmp.patch: Revert optimized POWER10 strcmp,
|
||||||
|
strncmp implementations (CVE-2025-5745, CVE-2025-5702, bsc#1244184,
|
||||||
|
bsc#1244182, BZ #33060, BZ #33056)
|
||||||
|
- ppc64le-revert-power10-memcmp.patch: Revert optimized POWER10 memcmp
|
||||||
|
implementation (BZ #33059)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Jun 2 10:54:37 UTC 2025 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Filter GLIBC_PRIVATE symbols again
|
||||||
|
- Drop ngpt provides
|
||||||
|
- Refine libc_nonshared.a workaround
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Apr 18 19:50:23 UTC 2025 - Giuliano Belinassi <giuliano.belinassi@suse.com>
|
||||||
|
|
||||||
|
- Enable Userspace Livepatching on ppc64le (jsc#PED-7395)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Mar 12 10:28:15 UTC 2025 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Do not build libnsl1 (bsc#1239459)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Feb 26 15:29:17 UTC 2025 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Bump minimal kernel version to 4.3 to enable use of direct socketcalls
|
||||||
|
on x86-32 and s390x (bsc#1234713)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Feb 20 09:53:20 UTC 2025 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Build cross-hppa and cross-loongarch64 only with gcc >= 14
|
||||||
|
- round-log10p1f.patch: math: Fix log10p1f internal table value (BZ
|
||||||
|
#32626)
|
||||||
|
- round-sinhf.patch: math: Fix sinhf for some inputs (BZ #32627)
|
||||||
|
- nptl-stack-size-up.patch: nptl: Correct stack size attribute when stack
|
||||||
|
grows up (BZ #32574)
|
||||||
|
- round-tanf.patch: math: Fix tanf for some inputs (BZ 32630)
|
||||||
|
- tst-aarch64-pkey.patch: Fix tst-aarch64-pkey to handle ENOSPC as not
|
||||||
|
supported
|
||||||
|
- float128-sycl.patch: x86 (__HAVE_FLOAT128): Defined to 0 for Intel SYCL
|
||||||
|
compiler (BZ #32723)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 17 10:37:02 UTC 2025 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Remove nis from nsswitch.conf (bsc#1237210)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 10 12:19:00 UTC 2025 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Use rpm.execute when available (bsc#1236869)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jan 29 09:19:29 UTC 2025 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Update to glibc 2.41
|
||||||
|
* In /etc/resolv.conf and the RES_OPTIONS environment variable, option
|
||||||
|
flags can now be prefixed with “-” to clear previously set flags
|
||||||
|
* The DNS stub resolver now supports the strict-error option
|
||||||
|
* On Linux, the sched_setattr and sched_getattr functions have been
|
||||||
|
added
|
||||||
|
* The iconv program now supports converting files in place
|
||||||
|
* Character encoding, character type info, and transliteration tables
|
||||||
|
have been updated to Unicode 16.0.0
|
||||||
|
* The following ISO C23 function families (introduced in TS
|
||||||
|
18661-4:2015) are now supported in <math.h>:
|
||||||
|
- Trigonometric functions: acospi, asinpi, atan2pi, atanpi, cospi,
|
||||||
|
sinpi, tanpi.
|
||||||
|
* The GNU C Library now supports a feature test macro _ISOC2Y_SOURCE to
|
||||||
|
enable features from the draft ISO C2Y standard
|
||||||
|
* Optimized and correctly rounded exp10m1f, exp2m1f, expm1f, log10f,
|
||||||
|
log2p1f, log1pf, log10p1f, cbrtf, erff, erfcf, lgammaf, tgammaf,
|
||||||
|
tanf, acosf, acoshf, asinf, asinhf, atanf, atan2f, atanhf, coshf,
|
||||||
|
sinhf, and tanhf functions have been added from the CORE-MATH
|
||||||
|
project <https://core-math.gitlabpages.inria.fr/>
|
||||||
|
* A new tunable, glibc.rtld.execstack, can be used to control whether an
|
||||||
|
executable stack is allowed from the main program, either implicitly
|
||||||
|
due to a mising GNU_STACK ELF header or explicit explicitly because
|
||||||
|
of the executable bit in GNU_STACK
|
||||||
|
* Support for the extensible rseq ABI introduced in the Linux kernel
|
||||||
|
version 6.3 has been added
|
||||||
|
* The GNU C Library now supports the Guarded Control Stack extension
|
||||||
|
that allows to use shadow stacks on AArch64 systems that support this
|
||||||
|
extension
|
||||||
|
* Significant effort has been put into improving the code generation
|
||||||
|
and speed of mathematical functions in the vector mathematics library
|
||||||
|
on AArch64, with regard to the Scalable Vector Extension (SVE) and
|
||||||
|
Advanced SIMD (Neon) intrinsics
|
||||||
|
* Support for memory protection keys on AArch64 systems with enabled
|
||||||
|
Stage 1 permission overlays feature as introduced in Armv8.9 / 9.4
|
||||||
|
has been added
|
||||||
|
* On PowerPC64, support for the return-oriented programming protection
|
||||||
|
instructions added in ISA 3.1 (Power10) has been added, as well as
|
||||||
|
function optimizations for Power10
|
||||||
|
* A new architecture type has been introduced internally to better
|
||||||
|
support Hygon x86-64 processors
|
||||||
|
* abort is now async-signal-safe and its implementation makes longjmp
|
||||||
|
from the SIGABRT handler always abort if set up with setjmp
|
||||||
|
* dlopen and dlmopen no longer make the stack executable if a shared
|
||||||
|
library requires it, either implicitly because of a missing GNU_STACK
|
||||||
|
ELF header (and default ABI permission having the executable bit set)
|
||||||
|
or explicitly because of the executable bit in GNU_STACK, and the
|
||||||
|
stack is not already executable
|
||||||
|
* On recent Linux kernels with vDSO getrandom support, getrandom does
|
||||||
|
not act as a "shall occur" cancellation point, in which case it might
|
||||||
|
not issue a syscall or trigger a deferred cancellation event
|
||||||
|
* GLIBC-SA-2025-0001: assert: Buffer overflow when printing assertion
|
||||||
|
failure message (CVE-2025-0395)
|
||||||
|
- Add cross-hppa and cross-loongarch64 packages
|
||||||
|
- gen-tempname-randomness.patch: Removed
|
||||||
|
- ulp-prologue-into-asm-functions.patch: Rebase
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Jan 20 13:33:58 UTC 2025 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Disable nscd support (bsc#1235247)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jan 7 10:28:36 UTC 2025 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Correctly determine livepatching support
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun Jan 5 11:43:47 UTC 2025 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Define _enable_debug_packages for rpm 4.20
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Dec 2 14:02:08 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Add support for loongarch64
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Oct 9 07:42:01 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Apply libc_nonshared.a workaround also on s390x and ppc64le (bsc#1231051)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 30 20:56:18 UTC 2024 - Stanislav Brabec <sbrabec@suse.com>
|
||||||
|
|
||||||
|
- langpacks are no more used. Drop glibc-2.3.90-langpackdir.diff.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Sep 26 11:45:57 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- gen-tempname-randomness.patch: Fix missing randomness in __gen_tempname
|
||||||
|
(bsc#1230965, BZ #32214)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Sep 18 15:11:48 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Use nss-systemd by default also in SLE (bsc#1230638)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Jul 29 07:50:31 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Update to glibc 2.40
|
||||||
|
* 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,
|
||||||
|
stdbit-builtins.patch, utmp-time-bits.patch: Removed
|
||||||
|
- glibc-2.3.90-langpackdir.diff: Rediff
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jun 3 08:24:38 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
|
Mon Jun 3 08:24:38 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||||
|
|
||||||
- Also provide glibc-locale-base-<targettype> from
|
- Also provide glibc-locale-base-<targettype> from
|
||||||
glibc-<targettype>: the package was merged in the baselibs.conf
|
glibc-gconv-modules-extra-<targettype>: the package was merged in the
|
||||||
case, so the capability is there. Steam for one has a requires
|
baselibs.conf case, so the capability is there. Steam for one has a
|
||||||
on the symbol (boo#1225809).
|
requires on the symbol (boo#1225809).
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue May 28 07:27:01 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
Tue May 28 07:27:01 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
- Obsolete glibc-locale-base-<targettype> from glibc-<targettype>
|
- Obsolete glibc-locale-base-<targettype> from glibc-<targettype>
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu May 23 11:31:34 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
- Add workaround for invalid use of libc_nonshared.a with non-SUSE libc
|
||||||
|
(bsc#1221482)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue May 21 09:44:46 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
Tue May 21 09:44:46 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
@@ -140,6 +340,7 @@ Thu Feb 1 09:25:37 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
|||||||
sem-open-o-creat.patch, setxid-propagate-glibc-tunables.patch,
|
sem-open-o-creat.patch, setxid-propagate-glibc-tunables.patch,
|
||||||
syslog-buffer-overflow.patch, tls-modid-reuse.patch,
|
syslog-buffer-overflow.patch, tls-modid-reuse.patch,
|
||||||
tunables-string-parsing.patch: Removed
|
tunables-string-parsing.patch: Removed
|
||||||
|
- CVE-2025-4802
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Jan 31 09:25:16 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
Wed Jan 31 09:25:16 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
||||||
|
7944
glibc.keyring
7944
glibc.keyring
File diff suppressed because it is too large
Load Diff
242
glibc.spec
242
glibc.spec
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package glibc
|
# spec file for package glibc
|
||||||
#
|
#
|
||||||
# Copyright (c) 2024 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -34,6 +34,12 @@
|
|||||||
%if "%flavor" == "cross-aarch64"
|
%if "%flavor" == "cross-aarch64"
|
||||||
%define cross_cpu aarch64
|
%define cross_cpu aarch64
|
||||||
%endif
|
%endif
|
||||||
|
%if "%flavor" == "cross-hppa"
|
||||||
|
%define cross_cpu hppa
|
||||||
|
%endif
|
||||||
|
%if "%flavor" == "cross-loongarch64"
|
||||||
|
%define cross_cpu loongarch64
|
||||||
|
%endif
|
||||||
%if "%flavor" == "cross-riscv64"
|
%if "%flavor" == "cross-riscv64"
|
||||||
%define cross_cpu riscv64
|
%define cross_cpu riscv64
|
||||||
%endif
|
%endif
|
||||||
@@ -51,21 +57,20 @@
|
|||||||
%define sysroot %{_prefix}/%{binutils_os}/sys-root
|
%define sysroot %{_prefix}/%{binutils_os}/sys-root
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?suse_version} >= 1550
|
%if %{suse_version} >= 1550
|
||||||
%bcond_without usrmerged
|
%bcond_without usrmerged
|
||||||
%else
|
%else
|
||||||
%bcond_with usrmerged
|
%bcond_with usrmerged
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?gcc_version} < 13
|
%if %{suse_version} >= 1600
|
||||||
%define with_gcc 13
|
%bcond_with nscd
|
||||||
|
%else
|
||||||
|
%bcond_without nscd
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Enable support for livepatching.
|
%if 0%{?gcc_version} < 13
|
||||||
%ifarch x86_64
|
%define with_gcc 13
|
||||||
%bcond_without livepatching
|
|
||||||
%else
|
|
||||||
%bcond_with livepatching
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%bcond_with build_all
|
%bcond_with build_all
|
||||||
@@ -95,20 +100,47 @@ ExclusiveArch: do_not_build
|
|||||||
%define build_testsuite 0
|
%define build_testsuite 0
|
||||||
%define build_cross 1
|
%define build_cross 1
|
||||||
%undefine _build_create_debug
|
%undefine _build_create_debug
|
||||||
|
%define _enable_debug_packages 0
|
||||||
ExcludeArch: %{cross_arch}
|
ExcludeArch: %{cross_arch}
|
||||||
%if 0%{?suse_version} < 1600
|
%if %{suse_version} < 1600
|
||||||
ExclusiveArch: do_not_build
|
ExclusiveArch: do_not_build
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
%define host_arch %{?cross_cpu}%{!?cross_cpu:%{_target_cpu}}
|
%define host_arch %{?cross_cpu}%{!?cross_cpu:%{_target_cpu}}
|
||||||
|
|
||||||
|
# Enable support for livepatching.
|
||||||
|
%define have_livepatching_support 0
|
||||||
|
%if %{build_cross}
|
||||||
|
%if "%{cross_arch}" == "x86_64" || "%{cross_arch}" == "ppc64le"
|
||||||
|
%define have_livepatching_support 1
|
||||||
|
%endif
|
||||||
|
%else
|
||||||
|
%ifarch x86_64 ppc64le
|
||||||
|
%define have_livepatching_support 1
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{have_livepatching_support}
|
||||||
|
%bcond_without livepatching
|
||||||
|
%else
|
||||||
|
%bcond_with livepatching
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{suse_version} >= 1600
|
||||||
|
%define build_libnsl1 0
|
||||||
|
%else
|
||||||
|
%define build_libnsl1 1
|
||||||
|
%endif
|
||||||
|
|
||||||
%if %{build_main}
|
%if %{build_main}
|
||||||
%define name_suffix %{nil}
|
%define name_suffix %{nil}
|
||||||
%else
|
%else
|
||||||
%define name_suffix -%{flavor}-src
|
%define name_suffix -%{flavor}-src
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%define __filter_GLIBC_PRIVATE 1
|
# Nothing outside of glibc must use these symbols
|
||||||
|
%define __requires_exclude GLIBC_PRIVATE
|
||||||
|
%define __provides_exclude GLIBC_PRIVATE
|
||||||
%ifarch i686
|
%ifarch i686
|
||||||
# For i686 let's only build what's different from i586, so
|
# For i686 let's only build what's different from i586, so
|
||||||
# no need to build documentation
|
# no need to build documentation
|
||||||
@@ -133,29 +165,31 @@ ExclusiveArch: do_not_build
|
|||||||
%define disable_assert 0
|
%define disable_assert 0
|
||||||
%define enable_stackguard_randomization 1
|
%define enable_stackguard_randomization 1
|
||||||
# glibc requires at least kernel 3.2
|
# glibc requires at least kernel 3.2
|
||||||
%define enablekernel 3.2
|
# Bump to 4.3 to enable use of direct socketcalls on x86-32 and s390x
|
||||||
|
%define enablekernel 4.3
|
||||||
# some architectures need a newer kernel
|
# some architectures need a newer kernel
|
||||||
%ifarch ppc64le
|
|
||||||
%define enablekernel 3.10
|
|
||||||
%endif
|
|
||||||
%ifarch aarch64
|
|
||||||
%define enablekernel 3.7
|
|
||||||
%endif
|
|
||||||
%ifarch ia64
|
|
||||||
%define enablekernel 3.2.18
|
|
||||||
%endif
|
|
||||||
%ifarch riscv64
|
%ifarch riscv64
|
||||||
%define enablekernel 4.15
|
%define enablekernel 4.15
|
||||||
%endif
|
%endif
|
||||||
|
%ifarch loongarch64
|
||||||
|
%define enablekernel 5.19
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# Before 2.29
|
||||||
|
%define libnsl_archs %ix86 %alpha hppa m68k %mips32 %mips64 %sparc ppc ppc64 ppc64le x86_64 s390 s390x %arm aarch64 riscv64
|
||||||
|
# Before 2.34
|
||||||
|
%define libutil_archs %libnsl_archs
|
||||||
|
# Before 2.35
|
||||||
|
%define libanl_archs %libutil_archs
|
||||||
|
|
||||||
Name: glibc%{name_suffix}
|
Name: glibc%{name_suffix}
|
||||||
Summary: Standard Shared Libraries (from the GNU C Library)
|
Summary: Standard Shared Libraries (from the GNU C Library)
|
||||||
License: GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH GCC-exception-2.0
|
License: GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH GCC-exception-2.0
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Version: 2.39
|
Version: 2.41
|
||||||
Release: 0
|
Release: 0
|
||||||
%if %{without snapshot}
|
%if %{without snapshot}
|
||||||
%define git_id ef321e23c2
|
%define git_id 74f59e9271
|
||||||
%define libversion %version
|
%define libversion %version
|
||||||
%else
|
%else
|
||||||
%define git_id %(echo %version | sed 's/.*\.g//')
|
%define git_id %(echo %version | sed 's/.*\.g//')
|
||||||
@@ -167,10 +201,9 @@ Source: https://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz
|
|||||||
%if %{without snapshot}
|
%if %{without snapshot}
|
||||||
Source1: https://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz.sig
|
Source1: https://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz.sig
|
||||||
%endif
|
%endif
|
||||||
Source2: http://savannah.gnu.org/project/memberlist-gpgkeys.php?group=libc&download=1#/glibc.keyring
|
Source2: https://savannah.gnu.org/project/release-gpgkeys.php?group=libc&download=1&file=./glibc.keyring
|
||||||
Source4: manpages.tar.bz2
|
Source4: manpages.tar.bz2
|
||||||
Source5: nsswitch.conf
|
Source5: nsswitch.conf
|
||||||
Source6: sle-nsswitch.conf
|
|
||||||
Source7: bindresvport.blacklist
|
Source7: bindresvport.blacklist
|
||||||
Source9: glibc.rpmlintrc
|
Source9: glibc.rpmlintrc
|
||||||
Source10: baselibs.conf
|
Source10: baselibs.conf
|
||||||
@@ -180,11 +213,9 @@ Source21: nscd.service
|
|||||||
Source22: nscd.sysusers
|
Source22: nscd.sysusers
|
||||||
|
|
||||||
%if %{build_main}
|
%if %{build_main}
|
||||||
# ngpt was used in 8.1 and SLES8
|
%if %{without nscd}
|
||||||
Obsoletes: ngpt < 2.2.2
|
Obsoletes: nscd <= %{version}
|
||||||
Obsoletes: ngpt-devel < 2.2.2
|
%endif
|
||||||
Provides: ngpt = 2.2.2
|
|
||||||
Provides: ngpt-devel = 2.2.2
|
|
||||||
Conflicts: kernel < %{enablekernel}
|
Conflicts: kernel < %{enablekernel}
|
||||||
%if %{with usrmerged}
|
%if %{with usrmerged}
|
||||||
# make sure we have post-usrmerge filesystem package
|
# make sure we have post-usrmerge filesystem package
|
||||||
@@ -248,6 +279,11 @@ BuildArch: i686
|
|||||||
# Sync only this build counter with the main build
|
# Sync only this build counter with the main build
|
||||||
#!BcntSyncTag: glibc
|
#!BcntSyncTag: glibc
|
||||||
%endif
|
%endif
|
||||||
|
%if 0%{?gcc_version} < 14
|
||||||
|
%if "%flavor" == "cross-loongarch64" || "%flavor" == "cross-hppa"
|
||||||
|
ExclusiveArch: do_not_build
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
###
|
###
|
||||||
# Patches are ordered in the following groups:
|
# Patches are ordered in the following groups:
|
||||||
@@ -276,8 +312,6 @@ Patch10: glibc-version.diff
|
|||||||
Patch13: glibc-2.3.2.no_archive.diff
|
Patch13: glibc-2.3.2.no_archive.diff
|
||||||
# PATCH-FIX-OPENSUSE -- add blacklist for bindresvport
|
# PATCH-FIX-OPENSUSE -- add blacklist for bindresvport
|
||||||
Patch14: glibc-bindresvport-blacklist.diff
|
Patch14: glibc-bindresvport-blacklist.diff
|
||||||
# PATCH-FIX-OPENSUSE prefer -lang rpm packages
|
|
||||||
Patch15: glibc-2.3.90-langpackdir.diff
|
|
||||||
# PATCH-FEATURE-SLE Use nscd user for nscd
|
# PATCH-FEATURE-SLE Use nscd user for nscd
|
||||||
Patch19: nscd-server-user.patch
|
Patch19: nscd-server-user.patch
|
||||||
# PATCH-FEATURE-SLE read nsswich.conf from /usr
|
# PATCH-FEATURE-SLE read nsswich.conf from /usr
|
||||||
@@ -302,33 +336,23 @@ Patch306: glibc-fix-double-loopback.diff
|
|||||||
%if %{without snapshot}
|
%if %{without snapshot}
|
||||||
###
|
###
|
||||||
# Patches from upstream
|
# Patches from upstream
|
||||||
|
# PATCH-FIX-UPSTREAM math: Fix log10p1f internal table value (BZ #32626)
|
||||||
|
Patch1000: round-log10p1f.patch
|
||||||
|
# PATCH-FIX-UPSTREAM math: Fix sinhf for some inputs (BZ #32627)
|
||||||
|
Patch1001: round-sinhf.patch
|
||||||
|
# PATCH-FIX-UPSTREAM nptl: Correct stack size attribute when stack grows up (BZ #32574)
|
||||||
|
Patch1002: nptl-stack-size-up.patch
|
||||||
|
# PATCH-FIX-UPSTREAM math: Fix tanf for some inputs (BZ 32630)
|
||||||
|
Patch1003: round-tanf.patch
|
||||||
|
# PATCH-FIX-UPSTREAM Fix tst-aarch64-pkey to handle ENOSPC as not supported
|
||||||
|
Patch1004: tst-aarch64-pkey.patch
|
||||||
|
# PATCH-FIX-UPSTREAM x86 (__HAVE_FLOAT128): Defined to 0 for Intel SYCL compiler (BZ #32723)
|
||||||
|
Patch1005: float128-sycl.patch
|
||||||
|
# PATCH-FIX-UPSTREAM Revert optimized POWER10 strcmp, strncmp implementations (CVE-2025-5745, CVE-2025-5702, BZ #33060, BZ #33056)
|
||||||
|
Patch1006: ppc64le-revert-power10-strcmp.patch
|
||||||
|
# PATCH-FIX-UPSTREAM Revert optimized POWER10 memcmp (BZ #33059)
|
||||||
|
Patch1007: ppc64le-revert-power10-memcmp.patch
|
||||||
###
|
###
|
||||||
# PATCH-FIX-UPSTREAM arm: Remove wrong ldr from _dl_start_user (BZ #31339)
|
|
||||||
Patch1000: arm-dl-start-user.patch
|
|
||||||
# PATCH-FIX-UPSTREAM S390: Do not clobber r7 in clone (BZ #31402)
|
|
||||||
Patch1001: s390-clone-error-clobber-r7.patch
|
|
||||||
# PATCH-FIX-UPSTREAM duplocale: protect use of global locale (BZ #23970)
|
|
||||||
Patch1002: duplocale-global-locale.patch
|
|
||||||
# PATCH-FIX-UPSTREAM linux/sigsetops: fix type confusion (BZ #31468)
|
|
||||||
Patch1003: sigisemptyset.patch
|
|
||||||
# PATCH-FIX-UPSTREAM Use gcc __builtin_stdc_* builtins in stdbit.h if possible
|
|
||||||
Patch1004: stdbit-builtins.patch
|
|
||||||
# PATCH-FIX-UPSTREAM iconv: ISO-2022-CN-EXT: fix out-of-bound writes when writing escape sequence (CVE-2024-2961)
|
|
||||||
Patch1005: iconv-iso-2022-cn-ext.patch
|
|
||||||
# PATCH-FIX-UPSTREAM login: structs utmp, utmpx, lastlog _TIME_BITS independence (BZ #30701)
|
|
||||||
Patch1006: utmp-time-bits.patch
|
|
||||||
# PATCH-FIX-UPSTREAM elf: Only process multiple tunable once (BZ #31686)
|
|
||||||
Patch1007: elf-parse-tunables.patch
|
|
||||||
# PATCH-FIX-UPSTREAM nscd: Stack-based buffer overflow in netgroup cache (CVE-2024-33599, BZ #31677)
|
|
||||||
Patch1008: glibc-CVE-2024-33599-nscd-Stack-based-buffer-overflow-in-n.patch
|
|
||||||
# PATCH-FIX-UPSTREAM nscd: Do not send missing not found response in addgetnetgrentX (CVE-2024-33600, BZ #31678)
|
|
||||||
Patch1009: glibc-CVE-2024-33600-nscd-Do-not-send-missing-not-found-re.patch
|
|
||||||
# PATCH-FIX-UPSTREAM nscd: Avoid null pointer crashes after notfound response (CVE-2024-33600, BZ #31678)
|
|
||||||
Patch1010: glibc-CVE-2024-33600-nscd-Avoid-null-pointer-crashes-after.patch
|
|
||||||
# PATCH-FIX-UPSTREAM nscd netgroup: Use two buffers in addgetnetgrentX (CVE-2024-33601, CVE-2024-33602, BZ #31680)
|
|
||||||
Patch1011: glibc-CVE-2024-33601-CVE-2024-33602-nscd-netgroup-Use-two.patch
|
|
||||||
# PATCH-FIX-UPSTREAM nscd: Use time_t for return type of addgetnetgrentX (CVE-2024-33602)
|
|
||||||
Patch1012: nscd-netgroup-cache-timeout.patch
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
###
|
###
|
||||||
@@ -546,7 +570,7 @@ Group: System/Libraries
|
|||||||
Network Support Library for legacy architectures. This library does not
|
Network Support Library for legacy architectures. This library does not
|
||||||
have support for IPv6.
|
have support for IPv6.
|
||||||
|
|
||||||
%if 0%{suse_version} >= 1500
|
%if %{suse_version} >= 1500
|
||||||
%define make_output_sync -Oline
|
%define make_output_sync -Oline
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@@ -604,6 +628,11 @@ for opt in $tmp; do
|
|||||||
%endif
|
%endif
|
||||||
%if %{build_cross}
|
%if %{build_cross}
|
||||||
-m*) ;; # remove all machine specific options for crosses
|
-m*) ;; # remove all machine specific options for crosses
|
||||||
|
%endif
|
||||||
|
%if "%{cross_arch}" == "hppa"
|
||||||
|
# -fstack-clash-protection is not supported on targets where the
|
||||||
|
# stack grows from lower to higher addresses
|
||||||
|
-fstack-clash-protection) ;;
|
||||||
%endif
|
%endif
|
||||||
*) BuildFlags+=" $opt" ;;
|
*) BuildFlags+=" $opt" ;;
|
||||||
esac
|
esac
|
||||||
@@ -693,7 +722,7 @@ profile="--disable-profile"
|
|||||||
%if %{build_cross}
|
%if %{build_cross}
|
||||||
--with-headers=%{sysroot}/usr/include \
|
--with-headers=%{sysroot}/usr/include \
|
||||||
%else
|
%else
|
||||||
%ifarch armv7hl ppc ppc64 ppc64le i686 x86_64 sparc sparc64 s390 s390x
|
%ifarch armv7hl ppc ppc64 ppc64le i686 x86_64 sparc sparc64 s390 s390x riscv64
|
||||||
--enable-multi-arch \
|
--enable-multi-arch \
|
||||||
%endif
|
%endif
|
||||||
%ifarch aarch64
|
%ifarch aarch64
|
||||||
@@ -709,7 +738,7 @@ profile="--disable-profile"
|
|||||||
--with-cpu=power7 \
|
--with-cpu=power7 \
|
||||||
%endif
|
%endif
|
||||||
%ifarch x86_64
|
%ifarch x86_64
|
||||||
%if %suse_version > 1500
|
%if %{suse_version} > 1500
|
||||||
--enable-cet \
|
--enable-cet \
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
@@ -730,8 +759,12 @@ profile="--disable-profile"
|
|||||||
%if %{with livepatching}
|
%if %{with livepatching}
|
||||||
--enable-userspace-livepatch \
|
--enable-userspace-livepatch \
|
||||||
%endif
|
%endif
|
||||||
--disable-crypt || \
|
--disable-crypt \
|
||||||
{
|
%if %{without nscd}
|
||||||
|
--disable-build-nscd \
|
||||||
|
--disable-nscd \
|
||||||
|
%endif
|
||||||
|
|| {
|
||||||
rc=$?;
|
rc=$?;
|
||||||
echo "------- BEGIN config.log ------";
|
echo "------- BEGIN config.log ------";
|
||||||
%{__cat} config.log;
|
%{__cat} config.log;
|
||||||
@@ -747,6 +780,46 @@ echo 'CFLAGS-.os += -fdump-ipa-clones' \
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
make %{?_smp_mflags} %{?make_output_sync}
|
make %{?_smp_mflags} %{?make_output_sync}
|
||||||
|
|
||||||
|
%if %{build_main} && !0%{?is_opensuse}
|
||||||
|
%ifarch x86_64 i686 s390x ppc64le
|
||||||
|
# Horrible workaround for bsc#1221482
|
||||||
|
%ifarch x86_64 i686
|
||||||
|
archsub=x86
|
||||||
|
%endif
|
||||||
|
%ifarch s390x
|
||||||
|
archsub=s390
|
||||||
|
%endif
|
||||||
|
%ifarch ppc64le
|
||||||
|
archsub=powerpc
|
||||||
|
%endif
|
||||||
|
xstatbuild ()
|
||||||
|
{
|
||||||
|
gcc -O2 -fpic -I ../sysdeps/unix/sysv/linux/$archsub -xc - -c -o $1stat$2.oS <<EOF
|
||||||
|
#include <bits/wordsize.h>
|
||||||
|
#include <xstatver.h>
|
||||||
|
int __$1xstat$2 (int, $3, void *);
|
||||||
|
|
||||||
|
int
|
||||||
|
__attribute__ ((visibility ("hidden")))
|
||||||
|
$1stat$2 ($3 file, void *buf)
|
||||||
|
{
|
||||||
|
return __$1xstat$2 (_STAT_VER, file, buf);
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
ar r libc_nonshared.a $1stat$2.oS
|
||||||
|
}
|
||||||
|
xstatbuild "" "" "const char *"
|
||||||
|
xstatbuild f "" int
|
||||||
|
xstatbuild l "" "const char *"
|
||||||
|
%ifarch i686
|
||||||
|
xstatbuild "" 64 "const char *"
|
||||||
|
xstatbuild f 64 int
|
||||||
|
xstatbuild l 64 "const char *"
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -756,8 +829,10 @@ cd ..
|
|||||||
make %{?_smp_mflags} %{?make_output_sync} -C cc-base html
|
make %{?_smp_mflags} %{?make_output_sync} -C cc-base html
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if %{with nscd}
|
||||||
# sysusers.d
|
# sysusers.d
|
||||||
%sysusers_generate_pre %{SOURCE22} nscd nscd.conf
|
%sysusers_generate_pre %{SOURCE22} nscd nscd.conf
|
||||||
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%if %{build_testsuite}
|
%if %{build_testsuite}
|
||||||
@@ -839,6 +914,9 @@ make %{?_smp_mflags} %{?make_output_sync} -C cc-base test t=elf/check-localplt
|
|||||||
%define rtldlib lib
|
%define rtldlib lib
|
||||||
%define rtld_name ld-linux-riscv64-lp64d.so.1
|
%define rtld_name ld-linux-riscv64-lp64d.so.1
|
||||||
%endif
|
%endif
|
||||||
|
%ifarch loongarch64
|
||||||
|
%define rtld_name ld-linux-loongarch-lp64d.so.1
|
||||||
|
%endif
|
||||||
|
|
||||||
%if %{with usrmerged}
|
%if %{with usrmerged}
|
||||||
%define rootsbindir %{_sbindir}
|
%define rootsbindir %{_sbindir}
|
||||||
@@ -943,10 +1021,10 @@ rm -rf %{buildroot}%{_datadir}/locale/*/
|
|||||||
# Miscelanna:
|
# Miscelanna:
|
||||||
|
|
||||||
install -m 644 %{SOURCE7} %{buildroot}/etc
|
install -m 644 %{SOURCE7} %{buildroot}/etc
|
||||||
%if %suse_version > 1500
|
%if %{suse_version} > 1500
|
||||||
install -D -m 644 %{SOURCE5} %{buildroot}%{_prefix}/etc/nsswitch.conf
|
install -D -m 644 %{SOURCE5} %{buildroot}%{_prefix}/etc/nsswitch.conf
|
||||||
%else
|
%else
|
||||||
install -m 644 %{SOURCE6} %{buildroot}/etc/nsswitch.conf
|
install -m 644 %{SOURCE5} %{buildroot}/etc/nsswitch.conf
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{build_html}
|
%if %{build_html}
|
||||||
@@ -956,6 +1034,7 @@ cp -p cc-base/manual/libc/*.html %{buildroot}%{_datadir}/doc/glibc
|
|||||||
|
|
||||||
cd manpages; make install_root=%{buildroot} install; cd ..
|
cd manpages; make install_root=%{buildroot} install; cd ..
|
||||||
|
|
||||||
|
%if %{with nscd}
|
||||||
# nscd tools:
|
# nscd tools:
|
||||||
|
|
||||||
%ifnarch i686
|
%ifnarch i686
|
||||||
@@ -965,6 +1044,7 @@ ln -sf %{rootsbindir}/service %{buildroot}%{_sbindir}/rcnscd
|
|||||||
mkdir -p %{buildroot}/run/nscd
|
mkdir -p %{buildroot}/run/nscd
|
||||||
mkdir -p %{buildroot}/var/lib/nscd
|
mkdir -p %{buildroot}/var/lib/nscd
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
#
|
#
|
||||||
# Create ld.so.conf
|
# Create ld.so.conf
|
||||||
@@ -993,6 +1073,11 @@ chmod 644 %{buildroot}%{_bindir}/ldd
|
|||||||
|
|
||||||
rm -f %{buildroot}%{rootsbindir}/sln
|
rm -f %{buildroot}%{rootsbindir}/sln
|
||||||
|
|
||||||
|
%if !%build_libnsl1
|
||||||
|
rm -f %{buildroot}%{slibdir}/libnsl.so.1
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with nscd}
|
||||||
%ifnarch i686
|
%ifnarch i686
|
||||||
mkdir -p %{buildroot}/usr/lib/tmpfiles.d/
|
mkdir -p %{buildroot}/usr/lib/tmpfiles.d/
|
||||||
install -m 644 %{SOURCE20} %{buildroot}/usr/lib/tmpfiles.d/
|
install -m 644 %{SOURCE20} %{buildroot}/usr/lib/tmpfiles.d/
|
||||||
@@ -1001,6 +1086,7 @@ install -m 644 %{SOURCE21} %{buildroot}/usr/lib/systemd/system
|
|||||||
mkdir -p %{buildroot}/usr/lib/sysusers.d/
|
mkdir -p %{buildroot}/usr/lib/sysusers.d/
|
||||||
install -m 644 %{SOURCE22} %{buildroot}/usr/lib/sysusers.d/nscd.conf
|
install -m 644 %{SOURCE22} %{buildroot}/usr/lib/sysusers.d/nscd.conf
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%if 0%{?rtld_oldname:1}
|
%if 0%{?rtld_oldname:1}
|
||||||
# Provide compatibility link
|
# Provide compatibility link
|
||||||
@@ -1027,8 +1113,10 @@ rm -rf %{buildroot}%{_libdir}/audit
|
|||||||
# Remove files from glibc-{extra,info,i18ndata}, nscd
|
# Remove files from glibc-{extra,info,i18ndata}, nscd
|
||||||
rm -rf %{buildroot}%{_infodir} %{buildroot}%{_prefix}/share/i18n
|
rm -rf %{buildroot}%{_infodir} %{buildroot}%{_prefix}/share/i18n
|
||||||
rm -f %{buildroot}%{_bindir}/makedb %{buildroot}/var/lib/misc/Makefile
|
rm -f %{buildroot}%{_bindir}/makedb %{buildroot}/var/lib/misc/Makefile
|
||||||
|
%if %{with nscd}
|
||||||
rm -f %{buildroot}%{_sbindir}/nscd
|
rm -f %{buildroot}%{_sbindir}/nscd
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%ifnarch i686
|
%ifnarch i686
|
||||||
# /var/lib/misc is incompatible with transactional updates (bsc#1138726)
|
# /var/lib/misc is incompatible with transactional updates (bsc#1138726)
|
||||||
@@ -1125,6 +1213,9 @@ rm %{buildroot}/sbin
|
|||||||
%if %{build_main}
|
%if %{build_main}
|
||||||
|
|
||||||
%post -p <lua>
|
%post -p <lua>
|
||||||
|
%if %{suse_version} >= 1600
|
||||||
|
exec = rpm.execute
|
||||||
|
%else
|
||||||
function exec(path, ...)
|
function exec(path, ...)
|
||||||
local pid = posix.fork()
|
local pid = posix.fork()
|
||||||
if pid == 0 then
|
if pid == 0 then
|
||||||
@@ -1137,6 +1228,7 @@ function exec(path, ...)
|
|||||||
end
|
end
|
||||||
posix.wait(pid)
|
posix.wait(pid)
|
||||||
end
|
end
|
||||||
|
%endif
|
||||||
|
|
||||||
-- First, get rid of platform-optimized libraries. We remove any we have
|
-- First, get rid of platform-optimized libraries. We remove any we have
|
||||||
-- ever built, since otherwise we might end up using some old leftover
|
-- ever built, since otherwise we might end up using some old leftover
|
||||||
@@ -1216,7 +1308,7 @@ exit 0
|
|||||||
%config /etc/ld.so.conf
|
%config /etc/ld.so.conf
|
||||||
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/ld.so.cache
|
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/ld.so.cache
|
||||||
%config(noreplace) /etc/rpc
|
%config(noreplace) /etc/rpc
|
||||||
%if %suse_version > 1500
|
%if %{suse_version} > 1500
|
||||||
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/nsswitch.conf
|
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/nsswitch.conf
|
||||||
%{_prefix}/etc/nsswitch.conf
|
%{_prefix}/etc/nsswitch.conf
|
||||||
%else
|
%else
|
||||||
@@ -1246,7 +1338,9 @@ exit 0
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%{slibdir}/libBrokenLocale.so.1
|
%{slibdir}/libBrokenLocale.so.1
|
||||||
|
%ifarch %libanl_archs
|
||||||
%{slibdir}/libanl.so.1
|
%{slibdir}/libanl.so.1
|
||||||
|
%endif
|
||||||
%{slibdir}/libc.so.6*
|
%{slibdir}/libc.so.6*
|
||||||
%{slibdir}/libc_malloc_debug.so.0
|
%{slibdir}/libc_malloc_debug.so.0
|
||||||
%{slibdir}/libdl.so.2*
|
%{slibdir}/libdl.so.2*
|
||||||
@@ -1263,7 +1357,9 @@ exit 0
|
|||||||
%{slibdir}/libresolv.so.2
|
%{slibdir}/libresolv.so.2
|
||||||
%{slibdir}/librt.so.1
|
%{slibdir}/librt.so.1
|
||||||
%{slibdir}/libthread_db.so.1
|
%{slibdir}/libthread_db.so.1
|
||||||
|
%ifarch %libutil_archs
|
||||||
%{slibdir}/libutil.so.1
|
%{slibdir}/libutil.so.1
|
||||||
|
%endif
|
||||||
%dir %attr(0700,root,root) /var/cache/ldconfig
|
%dir %attr(0700,root,root) /var/cache/ldconfig
|
||||||
%{rootsbindir}/ldconfig
|
%{rootsbindir}/ldconfig
|
||||||
%{_bindir}/gencat
|
%{_bindir}/gencat
|
||||||
@@ -1343,7 +1439,9 @@ exit 0
|
|||||||
%{_includedir}/*
|
%{_includedir}/*
|
||||||
%{_libdir}/*.o
|
%{_libdir}/*.o
|
||||||
%{_libdir}/libBrokenLocale.so
|
%{_libdir}/libBrokenLocale.so
|
||||||
|
%ifarch %libanl_archs
|
||||||
%{_libdir}/libanl.so
|
%{_libdir}/libanl.so
|
||||||
|
%endif
|
||||||
%{_libdir}/libc.so
|
%{_libdir}/libc.so
|
||||||
%{_libdir}/libc_malloc_debug.so
|
%{_libdir}/libc_malloc_debug.so
|
||||||
%{_libdir}/libm.so
|
%{_libdir}/libm.so
|
||||||
@@ -1371,7 +1469,9 @@ exit 0
|
|||||||
%files devel-static
|
%files devel-static
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_libdir}/libBrokenLocale.a
|
%{_libdir}/libBrokenLocale.a
|
||||||
|
%ifarch %libanl_archs
|
||||||
%{_libdir}/libanl.a
|
%{_libdir}/libanl.a
|
||||||
|
%endif
|
||||||
%{_libdir}/libc.a
|
%{_libdir}/libc.a
|
||||||
%{_libdir}/libm.a
|
%{_libdir}/libm.a
|
||||||
%ifarch x86_64 aarch64
|
%ifarch x86_64 aarch64
|
||||||
@@ -1397,6 +1497,7 @@ exit 0
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_prefix}/share/i18n
|
%{_prefix}/share/i18n
|
||||||
|
|
||||||
|
%if %{with nscd}
|
||||||
%files -n nscd
|
%files -n nscd
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%config(noreplace) /etc/nscd.conf
|
%config(noreplace) /etc/nscd.conf
|
||||||
@@ -1417,13 +1518,16 @@ exit 0
|
|||||||
%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/lib/nscd/services
|
%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/lib/nscd/services
|
||||||
%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/lib/nscd/netgroup
|
%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/lib/nscd/netgroup
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%if %{build_profile}
|
%if %{build_profile}
|
||||||
%files profile
|
%files profile
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_libdir}/libc_p.a
|
%{_libdir}/libc_p.a
|
||||||
%{_libdir}/libBrokenLocale_p.a
|
%{_libdir}/libBrokenLocale_p.a
|
||||||
|
%ifarch %libanl_archs
|
||||||
%{_libdir}/libanl_p.a
|
%{_libdir}/libanl_p.a
|
||||||
|
%endif
|
||||||
%{_libdir}/libm_p.a
|
%{_libdir}/libm_p.a
|
||||||
%ifarch x86_64 aarch64
|
%ifarch x86_64 aarch64
|
||||||
%{_libdir}/libmvec_p.a
|
%{_libdir}/libmvec_p.a
|
||||||
@@ -1431,7 +1535,9 @@ exit 0
|
|||||||
%{_libdir}/libpthread_p.a
|
%{_libdir}/libpthread_p.a
|
||||||
%{_libdir}/libresolv_p.a
|
%{_libdir}/libresolv_p.a
|
||||||
%{_libdir}/librt_p.a
|
%{_libdir}/librt_p.a
|
||||||
|
%ifarch %libutil_archs
|
||||||
%{_libdir}/libutil_p.a
|
%{_libdir}/libutil_p.a
|
||||||
|
%endif
|
||||||
%{_libdir}/libdl_p.a
|
%{_libdir}/libdl_p.a
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@@ -1445,10 +1551,12 @@ exit 0
|
|||||||
%files lang -f libc.lang
|
%files lang -f libc.lang
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%ifarch %ix86 %alpha hppa m68k %mips32 %mips64 %sparc ppc ppc64 ppc64le x86_64 s390 s390x %arm aarch64 riscv64
|
%if %build_libnsl1
|
||||||
|
%ifarch %libnsl_archs
|
||||||
%files -n libnsl1
|
%files -n libnsl1
|
||||||
%{slibdir}/libnsl.so.1
|
%{slibdir}/libnsl.so.1
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
@@ -1,216 +0,0 @@
|
|||||||
From 31da30f23cddd36db29d5b6a1c7619361b271fb4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Charles Fol <folcharles@gmail.com>
|
|
||||||
Date: Thu, 28 Mar 2024 12:25:38 -0300
|
|
||||||
Subject: [PATCH] iconv: ISO-2022-CN-EXT: fix out-of-bound writes when writing
|
|
||||||
escape sequence (CVE-2024-2961)
|
|
||||||
|
|
||||||
ISO-2022-CN-EXT uses escape sequences to indicate character set changes
|
|
||||||
(as specified by RFC 1922). While the SOdesignation has the expected
|
|
||||||
bounds checks, neither SS2designation nor SS3designation have its;
|
|
||||||
allowing a write overflow of 1, 2, or 3 bytes with fixed values:
|
|
||||||
'$+I', '$+J', '$+K', '$+L', '$+M', or '$*H'.
|
|
||||||
|
|
||||||
Checked on aarch64-linux-gnu.
|
|
||||||
|
|
||||||
Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
|
||||||
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
|
|
||||||
Tested-by: Carlos O'Donell <carlos@redhat.com>
|
|
||||||
|
|
||||||
(cherry picked from commit f9dc609e06b1136bb0408be9605ce7973a767ada)
|
|
||||||
---
|
|
||||||
iconvdata/Makefile | 5 +-
|
|
||||||
iconvdata/iso-2022-cn-ext.c | 12 +++
|
|
||||||
iconvdata/tst-iconv-iso-2022-cn-ext.c | 128 ++++++++++++++++++++++++++
|
|
||||||
3 files changed, 144 insertions(+), 1 deletion(-)
|
|
||||||
create mode 100644 iconvdata/tst-iconv-iso-2022-cn-ext.c
|
|
||||||
|
|
||||||
diff --git a/iconvdata/Makefile b/iconvdata/Makefile
|
|
||||||
index ea019ce5c0..7196a8744b 100644
|
|
||||||
--- a/iconvdata/Makefile
|
|
||||||
+++ b/iconvdata/Makefile
|
|
||||||
@@ -75,7 +75,8 @@ ifeq (yes,$(build-shared))
|
|
||||||
tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
|
|
||||||
tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 \
|
|
||||||
bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4 \
|
|
||||||
- bug-iconv13 bug-iconv14 bug-iconv15
|
|
||||||
+ bug-iconv13 bug-iconv14 bug-iconv15 \
|
|
||||||
+ tst-iconv-iso-2022-cn-ext
|
|
||||||
ifeq ($(have-thread-library),yes)
|
|
||||||
tests += bug-iconv3
|
|
||||||
endif
|
|
||||||
@@ -330,6 +331,8 @@ $(objpfx)bug-iconv14.out: $(addprefix $(objpfx), $(gconv-modules)) \
|
|
||||||
$(addprefix $(objpfx),$(modules.so))
|
|
||||||
$(objpfx)bug-iconv15.out: $(addprefix $(objpfx), $(gconv-modules)) \
|
|
||||||
$(addprefix $(objpfx),$(modules.so))
|
|
||||||
+$(objpfx)tst-iconv-iso-2022-cn-ext.out: $(addprefix $(objpfx), $(gconv-modules)) \
|
|
||||||
+ $(addprefix $(objpfx),$(modules.so))
|
|
||||||
|
|
||||||
$(objpfx)iconv-test.out: run-iconv-test.sh \
|
|
||||||
$(addprefix $(objpfx), $(gconv-modules)) \
|
|
||||||
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
|
|
||||||
index b34c8a36f4..cce29b1969 100644
|
|
||||||
--- a/iconvdata/iso-2022-cn-ext.c
|
|
||||||
+++ b/iconvdata/iso-2022-cn-ext.c
|
|
||||||
@@ -574,6 +574,12 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
|
|
||||||
{ \
|
|
||||||
const char *escseq; \
|
|
||||||
\
|
|
||||||
+ if (outptr + 4 > outend) \
|
|
||||||
+ { \
|
|
||||||
+ result = __GCONV_FULL_OUTPUT; \
|
|
||||||
+ break; \
|
|
||||||
+ } \
|
|
||||||
+ \
|
|
||||||
assert (used == CNS11643_2_set); /* XXX */ \
|
|
||||||
escseq = "*H"; \
|
|
||||||
*outptr++ = ESC; \
|
|
||||||
@@ -587,6 +593,12 @@ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
|
|
||||||
{ \
|
|
||||||
const char *escseq; \
|
|
||||||
\
|
|
||||||
+ if (outptr + 4 > outend) \
|
|
||||||
+ { \
|
|
||||||
+ result = __GCONV_FULL_OUTPUT; \
|
|
||||||
+ break; \
|
|
||||||
+ } \
|
|
||||||
+ \
|
|
||||||
assert ((used >> 5) >= 3 && (used >> 5) <= 7); \
|
|
||||||
escseq = "+I+J+K+L+M" + ((used >> 5) - 3) * 2; \
|
|
||||||
*outptr++ = ESC; \
|
|
||||||
diff --git a/iconvdata/tst-iconv-iso-2022-cn-ext.c b/iconvdata/tst-iconv-iso-2022-cn-ext.c
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..96a8765fd5
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/iconvdata/tst-iconv-iso-2022-cn-ext.c
|
|
||||||
@@ -0,0 +1,128 @@
|
|
||||||
+/* Verify ISO-2022-CN-EXT does not write out of the bounds.
|
|
||||||
+ Copyright (C) 2024 Free Software Foundation, Inc.
|
|
||||||
+ This file is part of the GNU C Library.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
+ modify it under the terms of the GNU Lesser General Public
|
|
||||||
+ License as published by the Free Software Foundation; either
|
|
||||||
+ version 2.1 of the License, or (at your option) any later version.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
+ Lesser General Public License for more details.
|
|
||||||
+
|
|
||||||
+ You should have received a copy of the GNU Lesser General Public
|
|
||||||
+ License along with the GNU C Library; if not, see
|
|
||||||
+ <https://www.gnu.org/licenses/>. */
|
|
||||||
+
|
|
||||||
+#include <stdio.h>
|
|
||||||
+#include <string.h>
|
|
||||||
+
|
|
||||||
+#include <errno.h>
|
|
||||||
+#include <iconv.h>
|
|
||||||
+#include <sys/mman.h>
|
|
||||||
+
|
|
||||||
+#include <support/xunistd.h>
|
|
||||||
+#include <support/check.h>
|
|
||||||
+#include <support/support.h>
|
|
||||||
+
|
|
||||||
+/* The test sets up a two memory page buffer with the second page marked
|
|
||||||
+ PROT_NONE to trigger a fault if the conversion writes beyond the exact
|
|
||||||
+ expected amount. Then we carry out various conversions and precisely
|
|
||||||
+ place the start of the output buffer in order to trigger a SIGSEGV if the
|
|
||||||
+ process writes anywhere between 1 and page sized bytes more (only one
|
|
||||||
+ PROT_NONE page is setup as a canary) than expected. These tests exercise
|
|
||||||
+ all three of the cases in ISO-2022-CN-EXT where the converter must switch
|
|
||||||
+ character sets and may run out of buffer space while doing the
|
|
||||||
+ operation. */
|
|
||||||
+
|
|
||||||
+static int
|
|
||||||
+do_test (void)
|
|
||||||
+{
|
|
||||||
+ iconv_t cd = iconv_open ("ISO-2022-CN-EXT", "UTF-8");
|
|
||||||
+ TEST_VERIFY_EXIT (cd != (iconv_t) -1);
|
|
||||||
+
|
|
||||||
+ char *ntf;
|
|
||||||
+ size_t ntfsize;
|
|
||||||
+ char *outbufbase;
|
|
||||||
+ {
|
|
||||||
+ int pgz = getpagesize ();
|
|
||||||
+ TEST_VERIFY_EXIT (pgz > 0);
|
|
||||||
+ ntfsize = 2 * pgz;
|
|
||||||
+
|
|
||||||
+ ntf = xmmap (NULL, ntfsize, PROT_READ | PROT_WRITE, MAP_PRIVATE
|
|
||||||
+ | MAP_ANONYMOUS, -1);
|
|
||||||
+ xmprotect (ntf + pgz, pgz, PROT_NONE);
|
|
||||||
+
|
|
||||||
+ outbufbase = ntf + pgz;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* Check if SOdesignation escape sequence does not trigger an OOB write. */
|
|
||||||
+ {
|
|
||||||
+ char inbuf[] = "\xe4\xba\xa4\xe6\x8d\xa2";
|
|
||||||
+
|
|
||||||
+ for (int i = 0; i < 9; i++)
|
|
||||||
+ {
|
|
||||||
+ char *inp = inbuf;
|
|
||||||
+ size_t inleft = sizeof (inbuf) - 1;
|
|
||||||
+
|
|
||||||
+ char *outp = outbufbase - i;
|
|
||||||
+ size_t outleft = i;
|
|
||||||
+
|
|
||||||
+ TEST_VERIFY_EXIT (iconv (cd, &inp, &inleft, &outp, &outleft)
|
|
||||||
+ == (size_t) -1);
|
|
||||||
+ TEST_COMPARE (errno, E2BIG);
|
|
||||||
+
|
|
||||||
+ TEST_VERIFY_EXIT (iconv (cd, NULL, NULL, NULL, NULL) == 0);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* Same as before for SS2designation. */
|
|
||||||
+ {
|
|
||||||
+ char inbuf[] = "㴽 \xe3\xb4\xbd";
|
|
||||||
+
|
|
||||||
+ for (int i = 0; i < 14; i++)
|
|
||||||
+ {
|
|
||||||
+ char *inp = inbuf;
|
|
||||||
+ size_t inleft = sizeof (inbuf) - 1;
|
|
||||||
+
|
|
||||||
+ char *outp = outbufbase - i;
|
|
||||||
+ size_t outleft = i;
|
|
||||||
+
|
|
||||||
+ TEST_VERIFY_EXIT (iconv (cd, &inp, &inleft, &outp, &outleft)
|
|
||||||
+ == (size_t) -1);
|
|
||||||
+ TEST_COMPARE (errno, E2BIG);
|
|
||||||
+
|
|
||||||
+ TEST_VERIFY_EXIT (iconv (cd, NULL, NULL, NULL, NULL) == 0);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* Same as before for SS3designation. */
|
|
||||||
+ {
|
|
||||||
+ char inbuf[] = "劄 \xe5\x8a\x84";
|
|
||||||
+
|
|
||||||
+ for (int i = 0; i < 14; i++)
|
|
||||||
+ {
|
|
||||||
+ char *inp = inbuf;
|
|
||||||
+ size_t inleft = sizeof (inbuf) - 1;
|
|
||||||
+
|
|
||||||
+ char *outp = outbufbase - i;
|
|
||||||
+ size_t outleft = i;
|
|
||||||
+
|
|
||||||
+ TEST_VERIFY_EXIT (iconv (cd, &inp, &inleft, &outp, &outleft)
|
|
||||||
+ == (size_t) -1);
|
|
||||||
+ TEST_COMPARE (errno, E2BIG);
|
|
||||||
+
|
|
||||||
+ TEST_VERIFY_EXIT (iconv (cd, NULL, NULL, NULL, NULL) == 0);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ TEST_VERIFY_EXIT (iconv_close (cd) != -1);
|
|
||||||
+
|
|
||||||
+ xmunmap (ntf, ntfsize);
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+#include <support/test-driver.c>
|
|
||||||
--
|
|
||||||
2.44.0
|
|
||||||
|
|
40
nptl-stack-size-up.patch
Normal file
40
nptl-stack-size-up.patch
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
From cb7f20653724029be89224ed3a35d627cc5b4163 Mon Sep 17 00:00:00 2001
|
||||||
|
From: John David Anglin <danglin@gcc.gnu.org>
|
||||||
|
Date: Wed, 29 Jan 2025 16:51:16 -0500
|
||||||
|
Subject: [PATCH] nptl: Correct stack size attribute when stack grows up [BZ
|
||||||
|
#32574]
|
||||||
|
|
||||||
|
Set stack size attribute to the size of the mmap'd region only
|
||||||
|
when the size of the remaining stack space is less than the size
|
||||||
|
of the mmap'd region.
|
||||||
|
|
||||||
|
This was reversed. As a result, the initial stack size was only
|
||||||
|
135168 bytes. On architectures where the stack grows down, the
|
||||||
|
initial stack size is approximately 8384512 bytes with the default
|
||||||
|
rlimit settings. The small main stack size on hppa broke
|
||||||
|
applications like ruby that check for stack overflows.
|
||||||
|
|
||||||
|
Signed-off-by: John David Anglin <dave.anglin@bell.net>
|
||||||
|
---
|
||||||
|
nptl/pthread_getattr_np.c | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c
|
||||||
|
index e98e2df152..43dd16d59c 100644
|
||||||
|
--- a/nptl/pthread_getattr_np.c
|
||||||
|
+++ b/nptl/pthread_getattr_np.c
|
||||||
|
@@ -145,9 +145,9 @@ __pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
|
||||||
|
> (size_t) iattr->stackaddr - last_to)
|
||||||
|
iattr->stacksize = (size_t) iattr->stackaddr - last_to;
|
||||||
|
#else
|
||||||
|
- /* The limit might be too high. */
|
||||||
|
+ /* The limit might be too low. */
|
||||||
|
if ((size_t) iattr->stacksize
|
||||||
|
- > to - (size_t) iattr->stackaddr)
|
||||||
|
+ < to - (size_t) iattr->stackaddr)
|
||||||
|
iattr->stacksize = to - (size_t) iattr->stackaddr;
|
||||||
|
#endif
|
||||||
|
/* We succeed and no need to look further. */
|
||||||
|
--
|
||||||
|
2.48.1
|
||||||
|
|
@@ -1,36 +0,0 @@
|
|||||||
From acc56074b0a5127631a64640aef1b7c5c103ebd8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Florian Weimer <fweimer@redhat.com>
|
|
||||||
Date: Thu, 2 May 2024 17:06:19 +0200
|
|
||||||
Subject: [PATCH] nscd: Use time_t for return type of addgetnetgrentX
|
|
||||||
|
|
||||||
Using int may give false results for future dates (timeouts after the
|
|
||||||
year 2028).
|
|
||||||
|
|
||||||
Fixes commit 04a21e050d64a1193a6daab872bca2528bda44b ("CVE-2024-33601,
|
|
||||||
CVE-2024-33602: nscd: netgroup: Use two buffers in addgetnetgrentX
|
|
||||||
(bug 31680)").
|
|
||||||
|
|
||||||
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
|
|
||||||
(cherry picked from commit 4bbca1a44691a6e9adcee5c6798a707b626bc331)
|
|
||||||
---
|
|
||||||
nscd/netgroupcache.c | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c
|
|
||||||
index e8fe041846..01d554af9c 100644
|
|
||||||
--- a/nscd/netgroupcache.c
|
|
||||||
+++ b/nscd/netgroupcache.c
|
|
||||||
@@ -680,8 +680,8 @@ readdinnetgr (struct database_dyn *db, struct hashentry *he,
|
|
||||||
.key_len = he->len
|
|
||||||
};
|
|
||||||
|
|
||||||
- int timeout = addinnetgrX (db, -1, &req, db->data + he->key, he->owner,
|
|
||||||
- he, dh);
|
|
||||||
+ time_t timeout = addinnetgrX (db, -1, &req, db->data + he->key, he->owner,
|
|
||||||
+ he, dh);
|
|
||||||
if (timeout < 0)
|
|
||||||
timeout = 0;
|
|
||||||
return timeout;
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
@@ -64,12 +64,12 @@ networks: files dns
|
|||||||
aliases: files usrfiles
|
aliases: files usrfiles
|
||||||
ethers: files usrfiles
|
ethers: files usrfiles
|
||||||
gshadow: files usrfiles
|
gshadow: files usrfiles
|
||||||
netgroup: files nis
|
netgroup: files
|
||||||
protocols: files usrfiles
|
protocols: files usrfiles
|
||||||
publickey: files
|
publickey: files
|
||||||
rpc: files usrfiles
|
rpc: files usrfiles
|
||||||
services: files usrfiles
|
services: files usrfiles
|
||||||
|
|
||||||
automount: files nis
|
automount: files
|
||||||
bootparams: files
|
bootparams: files
|
||||||
netmasks: files
|
netmasks: files
|
||||||
|
417
ppc64le-revert-power10-memcmp.patch
Normal file
417
ppc64le-revert-power10-memcmp.patch
Normal file
@@ -0,0 +1,417 @@
|
|||||||
|
Index: glibc-2.41/sysdeps/powerpc/powerpc64/le/power10/memchr.S
|
||||||
|
===================================================================
|
||||||
|
--- glibc-2.41.orig/sysdeps/powerpc/powerpc64/le/power10/memchr.S
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,315 +0,0 @@
|
||||||
|
-/* Optimized memchr implementation for POWER10 LE.
|
||||||
|
- Copyright (C) 2021-2025 Free Software Foundation, Inc.
|
||||||
|
- This file is part of the GNU C Library.
|
||||||
|
-
|
||||||
|
- The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
- modify it under the terms of the GNU Lesser General Public
|
||||||
|
- License as published by the Free Software Foundation; either
|
||||||
|
- version 2.1 of the License, or (at your option) any later version.
|
||||||
|
-
|
||||||
|
- The GNU C Library is distributed in the hope that it will be useful,
|
||||||
|
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
- Lesser General Public License for more details.
|
||||||
|
-
|
||||||
|
- You should have received a copy of the GNU Lesser General Public
|
||||||
|
- License along with the GNU C Library; if not, see
|
||||||
|
- <https://www.gnu.org/licenses/>. */
|
||||||
|
-
|
||||||
|
-#include <sysdep.h>
|
||||||
|
-
|
||||||
|
-# ifndef MEMCHR
|
||||||
|
-# define MEMCHR __memchr
|
||||||
|
-# endif
|
||||||
|
-# define M_VREG_ZERO v20
|
||||||
|
-# define M_OFF_START_LOOP 256
|
||||||
|
-# define MEMCHR_SUBTRACT_VECTORS \
|
||||||
|
- vsububm v4,v4,v18; \
|
||||||
|
- vsububm v5,v5,v18; \
|
||||||
|
- vsububm v6,v6,v18; \
|
||||||
|
- vsububm v7,v7,v18;
|
||||||
|
-# define M_TAIL(vreg,increment) \
|
||||||
|
- vctzlsbb r4,vreg; \
|
||||||
|
- cmpld r5,r4; \
|
||||||
|
- ble L(null); \
|
||||||
|
- addi r4,r4,increment; \
|
||||||
|
- add r3,r6,r4; \
|
||||||
|
- blr
|
||||||
|
-
|
||||||
|
-/* TODO: Replace macros by the actual instructions when minimum binutils becomes
|
||||||
|
- >= 2.35. This is used to keep compatibility with older versions. */
|
||||||
|
-#define M_VEXTRACTBM(rt,vrb) \
|
||||||
|
- .long(((4)<<(32-6)) \
|
||||||
|
- | ((rt)<<(32-11)) \
|
||||||
|
- | ((8)<<(32-16)) \
|
||||||
|
- | ((vrb)<<(32-21)) \
|
||||||
|
- | 1602)
|
||||||
|
-
|
||||||
|
-#define M_LXVP(xtp,dq,ra) \
|
||||||
|
- .long(((6)<<(32-6)) \
|
||||||
|
- | ((((xtp)-32)>>1)<<(32-10)) \
|
||||||
|
- | ((1)<<(32-11)) \
|
||||||
|
- | ((ra)<<(32-16)) \
|
||||||
|
- | dq)
|
||||||
|
-
|
||||||
|
-#define CHECK16B(vreg,offset,addr,label) \
|
||||||
|
- lxv vreg+32,offset(addr); \
|
||||||
|
- vcmpequb. vreg,vreg,v18; \
|
||||||
|
- bne cr6,L(label); \
|
||||||
|
- cmpldi r5,16; \
|
||||||
|
- ble L(null); \
|
||||||
|
- addi r5,r5,-16;
|
||||||
|
-
|
||||||
|
-/* Load 4 quadwords, merge into one VR for speed and check for NULLs. r6 has #
|
||||||
|
- of bytes already checked. */
|
||||||
|
-#define CHECK64B(offset,addr,label) \
|
||||||
|
- M_LXVP(v4+32,offset,addr); \
|
||||||
|
- M_LXVP(v6+32,offset+32,addr); \
|
||||||
|
- MEMCHR_SUBTRACT_VECTORS; \
|
||||||
|
- vminub v14,v4,v5; \
|
||||||
|
- vminub v15,v6,v7; \
|
||||||
|
- vminub v16,v14,v15; \
|
||||||
|
- vcmpequb. v0,v16,M_VREG_ZERO; \
|
||||||
|
- beq cr6,$+12; \
|
||||||
|
- li r7,offset; \
|
||||||
|
- b L(label); \
|
||||||
|
- cmpldi r5,64; \
|
||||||
|
- ble L(null); \
|
||||||
|
- addi r5,r5,-64
|
||||||
|
-
|
||||||
|
-/* Implements the function
|
||||||
|
- void *[r3] memchr (const void *s [r3], int c [r4], size_t n [r5]). */
|
||||||
|
-
|
||||||
|
- .machine power9
|
||||||
|
-
|
||||||
|
-ENTRY_TOCLESS (MEMCHR)
|
||||||
|
- CALL_MCOUNT 3
|
||||||
|
-
|
||||||
|
- cmpldi r5,0
|
||||||
|
- beq L(null)
|
||||||
|
- mr r0,r5
|
||||||
|
- xori r6,r4,0xff
|
||||||
|
-
|
||||||
|
- mtvsrd v18+32,r4 /* matching char in v18 */
|
||||||
|
- mtvsrd v19+32,r6 /* non matching char in v19 */
|
||||||
|
-
|
||||||
|
- vspltb v18,v18,7 /* replicate */
|
||||||
|
- vspltb v19,v19,7 /* replicate */
|
||||||
|
- vspltisb M_VREG_ZERO,0
|
||||||
|
-
|
||||||
|
- /* Next 16B-aligned address. Prepare address for L(aligned). */
|
||||||
|
- addi r6,r3,16
|
||||||
|
- clrrdi r6,r6,4
|
||||||
|
-
|
||||||
|
- /* Align data and fill bytes not loaded with non matching char. */
|
||||||
|
- lvx v0,0,r3
|
||||||
|
- lvsr v1,0,r3
|
||||||
|
- vperm v0,v19,v0,v1
|
||||||
|
-
|
||||||
|
- vcmpequb. v6,v0,v18
|
||||||
|
- bne cr6,L(found)
|
||||||
|
- sub r4,r6,r3
|
||||||
|
- cmpld r5,r4
|
||||||
|
- ble L(null)
|
||||||
|
- sub r5,r5,r4
|
||||||
|
-
|
||||||
|
- /* Test up to OFF_START_LOOP-16 bytes in 16B chunks. The main loop is
|
||||||
|
- optimized for longer strings, so checking the first bytes in 16B
|
||||||
|
- chunks benefits a lot small strings. */
|
||||||
|
- .p2align 5
|
||||||
|
-L(aligned):
|
||||||
|
- cmpldi r5,0
|
||||||
|
- beq L(null)
|
||||||
|
-
|
||||||
|
- CHECK16B(v0,0,r6,tail1)
|
||||||
|
- CHECK16B(v1,16,r6,tail2)
|
||||||
|
- CHECK16B(v2,32,r6,tail3)
|
||||||
|
- CHECK16B(v3,48,r6,tail4)
|
||||||
|
- CHECK16B(v4,64,r6,tail5)
|
||||||
|
- CHECK16B(v5,80,r6,tail6)
|
||||||
|
- CHECK16B(v6,96,r6,tail7)
|
||||||
|
- CHECK16B(v7,112,r6,tail8)
|
||||||
|
- CHECK16B(v8,128,r6,tail9)
|
||||||
|
- CHECK16B(v9,144,r6,tail10)
|
||||||
|
- CHECK16B(v10,160,r6,tail11)
|
||||||
|
- CHECK16B(v0,176,r6,tail12)
|
||||||
|
- CHECK16B(v1,192,r6,tail13)
|
||||||
|
- CHECK16B(v2,208,r6,tail14)
|
||||||
|
- CHECK16B(v3,224,r6,tail15)
|
||||||
|
-
|
||||||
|
- cmpdi cr5,r4,0 /* Check if c == 0. This will be useful to
|
||||||
|
- choose how we will perform the main loop. */
|
||||||
|
-
|
||||||
|
- /* Prepare address for the loop. */
|
||||||
|
- addi r4,r3,M_OFF_START_LOOP
|
||||||
|
- clrrdi r4,r4,6
|
||||||
|
- sub r6,r4,r3
|
||||||
|
- sub r5,r0,r6
|
||||||
|
- addi r6,r4,128
|
||||||
|
-
|
||||||
|
- /* If c == 0, use the loop without the vsububm. */
|
||||||
|
- beq cr5,L(loop)
|
||||||
|
-
|
||||||
|
- /* This is very similar to the block after L(loop), the difference is
|
||||||
|
- that here MEMCHR_SUBTRACT_VECTORS is not empty, and we subtract
|
||||||
|
- each byte loaded by the char we are looking for, this way we can keep
|
||||||
|
- using vminub to merge the results and checking for nulls. */
|
||||||
|
- .p2align 5
|
||||||
|
-L(memchr_loop):
|
||||||
|
- CHECK64B(0,r4,pre_tail_64b)
|
||||||
|
- CHECK64B(64,r4,pre_tail_64b)
|
||||||
|
- addi r4,r4,256
|
||||||
|
-
|
||||||
|
- CHECK64B(0,r6,tail_64b)
|
||||||
|
- CHECK64B(64,r6,tail_64b)
|
||||||
|
- addi r6,r6,256
|
||||||
|
-
|
||||||
|
- CHECK64B(0,r4,pre_tail_64b)
|
||||||
|
- CHECK64B(64,r4,pre_tail_64b)
|
||||||
|
- addi r4,r4,256
|
||||||
|
-
|
||||||
|
- CHECK64B(0,r6,tail_64b)
|
||||||
|
- CHECK64B(64,r6,tail_64b)
|
||||||
|
- addi r6,r6,256
|
||||||
|
-
|
||||||
|
- b L(memchr_loop)
|
||||||
|
- /* Switch to a more aggressive approach checking 64B each time. Use 2
|
||||||
|
- pointers 128B apart and unroll the loop once to make the pointer
|
||||||
|
- updates and usages separated enough to avoid stalls waiting for
|
||||||
|
- address calculation. */
|
||||||
|
- .p2align 5
|
||||||
|
-L(loop):
|
||||||
|
-#undef MEMCHR_SUBTRACT_VECTORS
|
||||||
|
-#define MEMCHR_SUBTRACT_VECTORS /* nothing */
|
||||||
|
- CHECK64B(0,r4,pre_tail_64b)
|
||||||
|
- CHECK64B(64,r4,pre_tail_64b)
|
||||||
|
- addi r4,r4,256
|
||||||
|
-
|
||||||
|
- CHECK64B(0,r6,tail_64b)
|
||||||
|
- CHECK64B(64,r6,tail_64b)
|
||||||
|
- addi r6,r6,256
|
||||||
|
-
|
||||||
|
- CHECK64B(0,r4,pre_tail_64b)
|
||||||
|
- CHECK64B(64,r4,pre_tail_64b)
|
||||||
|
- addi r4,r4,256
|
||||||
|
-
|
||||||
|
- CHECK64B(0,r6,tail_64b)
|
||||||
|
- CHECK64B(64,r6,tail_64b)
|
||||||
|
- addi r6,r6,256
|
||||||
|
-
|
||||||
|
- b L(loop)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(pre_tail_64b):
|
||||||
|
- mr r6,r4
|
||||||
|
-L(tail_64b):
|
||||||
|
- /* OK, we found a null byte. Let's look for it in the current 64-byte
|
||||||
|
- block and mark it in its corresponding VR. lxvp vx,0(ry) puts the
|
||||||
|
- low 16B bytes into vx+1, and the high into vx, so the order here is
|
||||||
|
- v5, v4, v7, v6. */
|
||||||
|
- vcmpequb v1,v5,M_VREG_ZERO
|
||||||
|
- vcmpequb v2,v4,M_VREG_ZERO
|
||||||
|
- vcmpequb v3,v7,M_VREG_ZERO
|
||||||
|
- vcmpequb v4,v6,M_VREG_ZERO
|
||||||
|
-
|
||||||
|
- /* Take into account the other 64B blocks we had already checked. */
|
||||||
|
- add r6,r6,r7
|
||||||
|
- /* Extract first bit of each byte. */
|
||||||
|
- M_VEXTRACTBM(r8,v1)
|
||||||
|
- M_VEXTRACTBM(r9,v2)
|
||||||
|
- M_VEXTRACTBM(r10,v3)
|
||||||
|
- M_VEXTRACTBM(r11,v4)
|
||||||
|
-
|
||||||
|
- /* Shift each value into their corresponding position. */
|
||||||
|
- sldi r9,r9,16
|
||||||
|
- sldi r10,r10,32
|
||||||
|
- sldi r11,r11,48
|
||||||
|
-
|
||||||
|
- /* Merge the results. */
|
||||||
|
- or r8,r8,r9
|
||||||
|
- or r9,r10,r11
|
||||||
|
- or r11,r9,r8
|
||||||
|
-
|
||||||
|
- cnttzd r0,r11 /* Count trailing zeros before the match. */
|
||||||
|
- cmpld r5,r0
|
||||||
|
- ble L(null)
|
||||||
|
- add r3,r6,r0 /* Compute final address. */
|
||||||
|
- blr
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail1):
|
||||||
|
- M_TAIL(v0,0)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail2):
|
||||||
|
- M_TAIL(v1,16)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail3):
|
||||||
|
- M_TAIL(v2,32)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail4):
|
||||||
|
- M_TAIL(v3,48)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail5):
|
||||||
|
- M_TAIL(v4,64)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail6):
|
||||||
|
- M_TAIL(v5,80)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail7):
|
||||||
|
- M_TAIL(v6,96)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail8):
|
||||||
|
- M_TAIL(v7,112)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail9):
|
||||||
|
- M_TAIL(v8,128)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail10):
|
||||||
|
- M_TAIL(v9,144)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail11):
|
||||||
|
- M_TAIL(v10,160)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail12):
|
||||||
|
- M_TAIL(v0,176)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail13):
|
||||||
|
- M_TAIL(v1,192)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail14):
|
||||||
|
- M_TAIL(v2,208)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(tail15):
|
||||||
|
- M_TAIL(v3,224)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(found):
|
||||||
|
- vctzlsbb r7,v6
|
||||||
|
- cmpld r5,r7
|
||||||
|
- ble L(null)
|
||||||
|
- add r3,r3,r7
|
||||||
|
- blr
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(null):
|
||||||
|
- li r3,0
|
||||||
|
- blr
|
||||||
|
-
|
||||||
|
-END (MEMCHR)
|
||||||
|
-
|
||||||
|
-weak_alias (__memchr, memchr)
|
||||||
|
-libc_hidden_builtin_def (memchr)
|
||||||
|
Index: glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/Makefile
|
||||||
|
===================================================================
|
||||||
|
--- glibc-2.41.orig/sysdeps/powerpc/powerpc64/multiarch/Makefile
|
||||||
|
+++ glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/Makefile
|
||||||
|
@@ -31,7 +31,7 @@ sysdep_routines += memcpy-power8-cached
|
||||||
|
strncase-power8
|
||||||
|
|
||||||
|
ifneq (,$(filter %le,$(config-machine)))
|
||||||
|
-sysdep_routines += memchr-power10 memcmp-power10 memcpy-power10 \
|
||||||
|
+sysdep_routines += memcmp-power10 memcpy-power10 \
|
||||||
|
memmove-power10 memset-power10 rawmemchr-power9 \
|
||||||
|
rawmemchr-power10 strcmp-power9 \
|
||||||
|
strncmp-power9 strcpy-power9 strcat-power10 \
|
||||||
|
Index: glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
|
||||||
|
===================================================================
|
||||||
|
--- glibc-2.41.orig/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
|
||||||
|
+++ glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
|
||||||
|
@@ -226,12 +226,6 @@ __libc_ifunc_impl_list (const char *name
|
||||||
|
|
||||||
|
/* Support sysdeps/powerpc/powerpc64/multiarch/memchr.c. */
|
||||||
|
IFUNC_IMPL (i, name, memchr,
|
||||||
|
-#ifdef __LITTLE_ENDIAN__
|
||||||
|
- IFUNC_IMPL_ADD (array, i, memchr,
|
||||||
|
- hwcap2 & PPC_FEATURE2_ARCH_3_1
|
||||||
|
- && hwcap & PPC_FEATURE_HAS_VSX,
|
||||||
|
- __memchr_power10)
|
||||||
|
-#endif
|
||||||
|
IFUNC_IMPL_ADD (array, i, memchr,
|
||||||
|
hwcap2 & PPC_FEATURE2_ARCH_2_07
|
||||||
|
&& hwcap & PPC_FEATURE_HAS_ALTIVEC,
|
||||||
|
Index: glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/memchr-power10.S
|
||||||
|
===================================================================
|
||||||
|
--- glibc-2.41.orig/sysdeps/powerpc/powerpc64/multiarch/memchr-power10.S
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,28 +0,0 @@
|
||||||
|
-/* Optimized memchr implementation for POWER10/PPC64.
|
||||||
|
- Copyright (C) 2016-2025 Free Software Foundation, Inc.
|
||||||
|
- This file is part of the GNU C Library.
|
||||||
|
-
|
||||||
|
- The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
- modify it under the terms of the GNU Lesser General Public
|
||||||
|
- License as published by the Free Software Foundation; either
|
||||||
|
- version 2.1 of the License, or (at your option) any later version.
|
||||||
|
-
|
||||||
|
- The GNU C Library is distributed in the hope that it will be useful,
|
||||||
|
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
- Lesser General Public License for more details.
|
||||||
|
-
|
||||||
|
- You should have received a copy of the GNU Lesser General Public
|
||||||
|
- License along with the GNU C Library; if not, see
|
||||||
|
- <https://www.gnu.org/licenses/>. */
|
||||||
|
-
|
||||||
|
-#if defined __LITTLE_ENDIAN__ && IS_IN (libc)
|
||||||
|
-#define MEMCHR __memchr_power10
|
||||||
|
-
|
||||||
|
-#undef libc_hidden_builtin_def
|
||||||
|
-#define libc_hidden_builtin_def(name)
|
||||||
|
-#undef weak_alias
|
||||||
|
-#define weak_alias(name,alias)
|
||||||
|
-
|
||||||
|
-#include <sysdeps/powerpc/powerpc64/le/power10/memchr.S>
|
||||||
|
-#endif
|
||||||
|
Index: glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/memchr.c
|
||||||
|
===================================================================
|
||||||
|
--- glibc-2.41.orig/sysdeps/powerpc/powerpc64/multiarch/memchr.c
|
||||||
|
+++ glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/memchr.c
|
||||||
|
@@ -25,23 +25,15 @@ extern __typeof (__memchr) __memchr_ppc
|
||||||
|
extern __typeof (__memchr) __memchr_power7 attribute_hidden;
|
||||||
|
extern __typeof (__memchr) __memchr_power8 attribute_hidden;
|
||||||
|
|
||||||
|
-# ifdef __LITTLE_ENDIAN__
|
||||||
|
-extern __typeof (__memchr) __memchr_power10 attribute_hidden;
|
||||||
|
-# endif
|
||||||
|
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
|
||||||
|
ifunc symbol properly. */
|
||||||
|
libc_ifunc (__memchr,
|
||||||
|
-# ifdef __LITTLE_ENDIAN__
|
||||||
|
- (hwcap2 & PPC_FEATURE2_ARCH_3_1
|
||||||
|
- && hwcap & PPC_FEATURE_HAS_VSX)
|
||||||
|
- ? __memchr_power10 :
|
||||||
|
-# endif
|
||||||
|
- (hwcap2 & PPC_FEATURE2_ARCH_2_07
|
||||||
|
- && hwcap & PPC_FEATURE_HAS_ALTIVEC)
|
||||||
|
- ? __memchr_power8 :
|
||||||
|
- (hwcap & PPC_FEATURE_ARCH_2_06)
|
||||||
|
- ? __memchr_power7
|
||||||
|
- : __memchr_ppc);
|
||||||
|
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07
|
||||||
|
+ && hwcap & PPC_FEATURE_HAS_ALTIVEC)
|
||||||
|
+ ? __memchr_power8 :
|
||||||
|
+ (hwcap & PPC_FEATURE_ARCH_2_06)
|
||||||
|
+ ? __memchr_power7
|
||||||
|
+ : __memchr_ppc);
|
||||||
|
|
||||||
|
weak_alias (__memchr, memchr)
|
||||||
|
libc_hidden_builtin_def (memchr)
|
658
ppc64le-revert-power10-strcmp.patch
Normal file
658
ppc64le-revert-power10-strcmp.patch
Normal file
@@ -0,0 +1,658 @@
|
|||||||
|
Index: glibc-2.41/sysdeps/powerpc/powerpc64/le/power10/strcmp.S
|
||||||
|
===================================================================
|
||||||
|
--- glibc-2.41.orig/sysdeps/powerpc/powerpc64/le/power10/strcmp.S
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,233 +0,0 @@
|
||||||
|
-/* Optimized strcmp implementation for PowerPC64/POWER10.
|
||||||
|
- Copyright (C) 2021-2025 Free Software Foundation, Inc.
|
||||||
|
- This file is part of the GNU C Library.
|
||||||
|
-
|
||||||
|
- The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
- modify it under the terms of the GNU Lesser General Public
|
||||||
|
- License as published by the Free Software Foundation; either
|
||||||
|
- version 2.1 of the License, or (at your option) any later version.
|
||||||
|
-
|
||||||
|
- The GNU C Library is distributed in the hope that it will be useful,
|
||||||
|
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
- Lesser General Public License for more details.
|
||||||
|
-
|
||||||
|
- You should have received a copy of the GNU Lesser General Public
|
||||||
|
- License along with the GNU C Library; if not, see
|
||||||
|
- <https://www.gnu.org/licenses/>. */
|
||||||
|
-#include <sysdep.h>
|
||||||
|
-
|
||||||
|
-#ifndef STRCMP
|
||||||
|
-# define STRCMP strcmp
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
-/* Implements the function
|
||||||
|
- int [r3] strcmp (const char *s1 [r3], const char *s2 [r4]). */
|
||||||
|
-
|
||||||
|
-/* TODO: Change this to actual instructions when minimum binutils is upgraded
|
||||||
|
- to 2.27. Macros are defined below for these newer instructions in order
|
||||||
|
- to maintain compatibility. */
|
||||||
|
-
|
||||||
|
-#define LXVP(xtp,dq,ra) \
|
||||||
|
- .long(((6)<<(32-6)) \
|
||||||
|
- | ((((xtp)-32)>>1)<<(32-10)) \
|
||||||
|
- | ((1)<<(32-11)) \
|
||||||
|
- | ((ra)<<(32-16)) \
|
||||||
|
- | dq)
|
||||||
|
-
|
||||||
|
-#define COMPARE_16(vreg1,vreg2,offset) \
|
||||||
|
- lxv vreg1+32,offset(r3); \
|
||||||
|
- lxv vreg2+32,offset(r4); \
|
||||||
|
- vcmpnezb. v7,vreg1,vreg2; \
|
||||||
|
- bne cr6,L(different); \
|
||||||
|
-
|
||||||
|
-#define COMPARE_32(vreg1,vreg2,offset,label1,label2) \
|
||||||
|
- LXVP(vreg1+32,offset,r3); \
|
||||||
|
- LXVP(vreg2+32,offset,r4); \
|
||||||
|
- vcmpnezb. v7,vreg1+1,vreg2+1; \
|
||||||
|
- bne cr6,L(label1); \
|
||||||
|
- vcmpnezb. v7,vreg1,vreg2; \
|
||||||
|
- bne cr6,L(label2); \
|
||||||
|
-
|
||||||
|
-#define TAIL(vreg1,vreg2) \
|
||||||
|
- vctzlsbb r6,v7; \
|
||||||
|
- vextubrx r5,r6,vreg1; \
|
||||||
|
- vextubrx r4,r6,vreg2; \
|
||||||
|
- subf r3,r4,r5; \
|
||||||
|
- blr; \
|
||||||
|
-
|
||||||
|
-#define CHECK_N_BYTES(reg1,reg2,len_reg) \
|
||||||
|
- sldi r0,len_reg,56; \
|
||||||
|
- lxvl 32+v4,reg1,r0; \
|
||||||
|
- lxvl 32+v5,reg2,r0; \
|
||||||
|
- add reg1,reg1,len_reg; \
|
||||||
|
- add reg2,reg2,len_reg; \
|
||||||
|
- vcmpnezb v7,v4,v5; \
|
||||||
|
- vctzlsbb r6,v7; \
|
||||||
|
- cmpld cr7,r6,len_reg; \
|
||||||
|
- blt cr7,L(different); \
|
||||||
|
-
|
||||||
|
- /* TODO: change this to .machine power10 when the minimum required
|
||||||
|
- binutils allows it. */
|
||||||
|
-
|
||||||
|
- .machine power9
|
||||||
|
-ENTRY_TOCLESS (STRCMP, 4)
|
||||||
|
- andi. r7,r3,4095
|
||||||
|
- andi. r8,r4,4095
|
||||||
|
- cmpldi cr0,r7,4096-16
|
||||||
|
- cmpldi cr1,r8,4096-16
|
||||||
|
- bgt cr0,L(crosses)
|
||||||
|
- bgt cr1,L(crosses)
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
-
|
||||||
|
-L(crosses):
|
||||||
|
- andi. r7,r3,15
|
||||||
|
- subfic r7,r7,16 /* r7(nalign1) = 16 - (str1 & 15). */
|
||||||
|
- andi. r9,r4,15
|
||||||
|
- subfic r5,r9,16 /* r5(nalign2) = 16 - (str2 & 15). */
|
||||||
|
- cmpld cr7,r7,r5
|
||||||
|
- beq cr7,L(same_aligned)
|
||||||
|
- blt cr7,L(nalign1_min)
|
||||||
|
-
|
||||||
|
- /* nalign2 is minimum and s2 pointer is aligned. */
|
||||||
|
- CHECK_N_BYTES(r3,r4,r5)
|
||||||
|
- /* Are we on the 64B hunk which crosses a page? */
|
||||||
|
- andi. r10,r3,63 /* Determine offset into 64B hunk. */
|
||||||
|
- andi. r8,r3,15 /* The offset into the 16B hunk. */
|
||||||
|
- neg r7,r3
|
||||||
|
- andi. r9,r7,15 /* Number of bytes after a 16B cross. */
|
||||||
|
- rlwinm. r7,r7,26,0x3F /* ((r3-4096))>>6&63. */
|
||||||
|
- beq L(compare_64_pagecross)
|
||||||
|
- mtctr r7
|
||||||
|
- b L(compare_64B_unaligned)
|
||||||
|
-
|
||||||
|
- /* nalign1 is minimum and s1 pointer is aligned. */
|
||||||
|
-L(nalign1_min):
|
||||||
|
- CHECK_N_BYTES(r3,r4,r7)
|
||||||
|
- /* Are we on the 64B hunk which crosses a page? */
|
||||||
|
- andi. r10,r4,63 /* Determine offset into 64B hunk. */
|
||||||
|
- andi. r8,r4,15 /* The offset into the 16B hunk. */
|
||||||
|
- neg r7,r4
|
||||||
|
- andi. r9,r7,15 /* Number of bytes after a 16B cross. */
|
||||||
|
- rlwinm. r7,r7,26,0x3F /* ((r4-4096))>>6&63. */
|
||||||
|
- beq L(compare_64_pagecross)
|
||||||
|
- mtctr r7
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(compare_64B_unaligned):
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- COMPARE_16(v4,v5,32)
|
||||||
|
- COMPARE_16(v4,v5,48)
|
||||||
|
- addi r3,r3,64
|
||||||
|
- addi r4,r4,64
|
||||||
|
- bdnz L(compare_64B_unaligned)
|
||||||
|
-
|
||||||
|
- /* Cross the page boundary of s2, carefully. Only for first
|
||||||
|
- iteration we have to get the count of 64B blocks to be checked.
|
||||||
|
- From second iteration and beyond, loop counter is always 63. */
|
||||||
|
-L(compare_64_pagecross):
|
||||||
|
- li r11, 63
|
||||||
|
- mtctr r11
|
||||||
|
- cmpldi r10,16
|
||||||
|
- ble L(cross_4)
|
||||||
|
- cmpldi r10,32
|
||||||
|
- ble L(cross_3)
|
||||||
|
- cmpldi r10,48
|
||||||
|
- ble L(cross_2)
|
||||||
|
-L(cross_1):
|
||||||
|
- CHECK_N_BYTES(r3,r4,r9)
|
||||||
|
- CHECK_N_BYTES(r3,r4,r8)
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- COMPARE_16(v4,v5,32)
|
||||||
|
- addi r3,r3,48
|
||||||
|
- addi r4,r4,48
|
||||||
|
- b L(compare_64B_unaligned)
|
||||||
|
-L(cross_2):
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- addi r3,r3,16
|
||||||
|
- addi r4,r4,16
|
||||||
|
- CHECK_N_BYTES(r3,r4,r9)
|
||||||
|
- CHECK_N_BYTES(r3,r4,r8)
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- addi r3,r3,32
|
||||||
|
- addi r4,r4,32
|
||||||
|
- b L(compare_64B_unaligned)
|
||||||
|
-L(cross_3):
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- addi r3,r3,32
|
||||||
|
- addi r4,r4,32
|
||||||
|
- CHECK_N_BYTES(r3,r4,r9)
|
||||||
|
- CHECK_N_BYTES(r3,r4,r8)
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- addi r3,r3,16
|
||||||
|
- addi r4,r4,16
|
||||||
|
- b L(compare_64B_unaligned)
|
||||||
|
-L(cross_4):
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- COMPARE_16(v4,v5,32)
|
||||||
|
- addi r3,r3,48
|
||||||
|
- addi r4,r4,48
|
||||||
|
- CHECK_N_BYTES(r3,r4,r9)
|
||||||
|
- CHECK_N_BYTES(r3,r4,r8)
|
||||||
|
- b L(compare_64B_unaligned)
|
||||||
|
-
|
||||||
|
-L(same_aligned):
|
||||||
|
- CHECK_N_BYTES(r3,r4,r7)
|
||||||
|
- /* Align s1 to 32B and adjust s2 address.
|
||||||
|
- Use lxvp only if both s1 and s2 are 32B aligned. */
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- COMPARE_16(v4,v5,32)
|
||||||
|
- COMPARE_16(v4,v5,48)
|
||||||
|
- addi r3,r3,64
|
||||||
|
- addi r4,r4,64
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
-
|
||||||
|
- clrldi r6,r3,59
|
||||||
|
- subfic r5,r6,32
|
||||||
|
- add r3,r3,r5
|
||||||
|
- add r4,r4,r5
|
||||||
|
- andi. r5,r4,0x1F
|
||||||
|
- beq cr0,L(32B_aligned_loop)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(16B_aligned_loop):
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- COMPARE_16(v4,v5,32)
|
||||||
|
- COMPARE_16(v4,v5,48)
|
||||||
|
- addi r3,r3,64
|
||||||
|
- addi r4,r4,64
|
||||||
|
- b L(16B_aligned_loop)
|
||||||
|
-
|
||||||
|
- /* Calculate and return the difference. */
|
||||||
|
-L(different):
|
||||||
|
- TAIL(v4,v5)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(32B_aligned_loop):
|
||||||
|
- COMPARE_32(v14,v16,0,tail1,tail2)
|
||||||
|
- COMPARE_32(v18,v20,32,tail3,tail4)
|
||||||
|
- COMPARE_32(v22,v24,64,tail5,tail6)
|
||||||
|
- COMPARE_32(v26,v28,96,tail7,tail8)
|
||||||
|
- addi r3,r3,128
|
||||||
|
- addi r4,r4,128
|
||||||
|
- b L(32B_aligned_loop)
|
||||||
|
-
|
||||||
|
-L(tail1): TAIL(v15,v17)
|
||||||
|
-L(tail2): TAIL(v14,v16)
|
||||||
|
-L(tail3): TAIL(v19,v21)
|
||||||
|
-L(tail4): TAIL(v18,v20)
|
||||||
|
-L(tail5): TAIL(v23,v25)
|
||||||
|
-L(tail6): TAIL(v22,v24)
|
||||||
|
-L(tail7): TAIL(v27,v29)
|
||||||
|
-L(tail8): TAIL(v26,v28)
|
||||||
|
-
|
||||||
|
-END (STRCMP)
|
||||||
|
-libc_hidden_builtin_def (strcmp)
|
||||||
|
Index: glibc-2.41/sysdeps/powerpc/powerpc64/le/power10/strncmp.S
|
||||||
|
===================================================================
|
||||||
|
--- glibc-2.41.orig/sysdeps/powerpc/powerpc64/le/power10/strncmp.S
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,271 +0,0 @@
|
||||||
|
-/* Optimized strncmp implementation for PowerPC64/POWER10.
|
||||||
|
- Copyright (C) 2024-2025 Free Software Foundation, Inc.
|
||||||
|
- This file is part of the GNU C Library.
|
||||||
|
-
|
||||||
|
- The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
- modify it under the terms of the GNU Lesser General Public
|
||||||
|
- License as published by the Free Software Foundation; either
|
||||||
|
- version 2.1 of the License, or (at your option) any later version.
|
||||||
|
-
|
||||||
|
- The GNU C Library is distributed in the hope that it will be useful,
|
||||||
|
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
- Lesser General Public License for more details.
|
||||||
|
-
|
||||||
|
- You should have received a copy of the GNU Lesser General Public
|
||||||
|
- License along with the GNU C Library; if not, see
|
||||||
|
- <https://www.gnu.org/licenses/>. */
|
||||||
|
-
|
||||||
|
-#include <sysdep.h>
|
||||||
|
-
|
||||||
|
-/* Implements the function
|
||||||
|
-
|
||||||
|
- int [r3] strncmp (const char *s1 [r3], const char *s2 [r4], size_t [r5] n)
|
||||||
|
-
|
||||||
|
- The implementation uses unaligned doubleword access to avoid specialized
|
||||||
|
- code paths depending of data alignment for first 32 bytes and uses
|
||||||
|
- vectorised loops after that. */
|
||||||
|
-
|
||||||
|
-#ifndef STRNCMP
|
||||||
|
-# define STRNCMP strncmp
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
-/* TODO: Change this to actual instructions when minimum binutils is upgraded
|
||||||
|
- to 2.27. Macros are defined below for these newer instructions in order
|
||||||
|
- to maintain compatibility. */
|
||||||
|
-
|
||||||
|
-#define LXVP(xtp,dq,ra) \
|
||||||
|
- .long(((6)<<(32-6)) \
|
||||||
|
- | ((((xtp)-32)>>1)<<(32-10)) \
|
||||||
|
- | ((1)<<(32-11)) \
|
||||||
|
- | ((ra)<<(32-16)) \
|
||||||
|
- | dq)
|
||||||
|
-
|
||||||
|
-#define COMPARE_16(vreg1,vreg2,offset) \
|
||||||
|
- lxv vreg1+32,offset(r3); \
|
||||||
|
- lxv vreg2+32,offset(r4); \
|
||||||
|
- vcmpnezb. v7,vreg1,vreg2; \
|
||||||
|
- bne cr6,L(different); \
|
||||||
|
- cmpldi cr7,r5,16; \
|
||||||
|
- ble cr7,L(ret0); \
|
||||||
|
- addi r5,r5,-16;
|
||||||
|
-
|
||||||
|
-#define COMPARE_32(vreg1,vreg2,offset,label1,label2) \
|
||||||
|
- LXVP(vreg1+32,offset,r3); \
|
||||||
|
- LXVP(vreg2+32,offset,r4); \
|
||||||
|
- vcmpnezb. v7,vreg1+1,vreg2+1; \
|
||||||
|
- bne cr6,L(label1); \
|
||||||
|
- vcmpnezb. v7,vreg1,vreg2; \
|
||||||
|
- bne cr6,L(label2); \
|
||||||
|
- cmpldi cr7,r5,32; \
|
||||||
|
- ble cr7,L(ret0); \
|
||||||
|
- addi r5,r5,-32;
|
||||||
|
-
|
||||||
|
-#define TAIL_FIRST_16B(vreg1,vreg2) \
|
||||||
|
- vctzlsbb r6,v7; \
|
||||||
|
- cmpld cr7,r5,r6; \
|
||||||
|
- ble cr7,L(ret0); \
|
||||||
|
- vextubrx r5,r6,vreg1; \
|
||||||
|
- vextubrx r4,r6,vreg2; \
|
||||||
|
- subf r3,r4,r5; \
|
||||||
|
- blr;
|
||||||
|
-
|
||||||
|
-#define TAIL_SECOND_16B(vreg1,vreg2) \
|
||||||
|
- vctzlsbb r6,v7; \
|
||||||
|
- addi r0,r6,16; \
|
||||||
|
- cmpld cr7,r5,r0; \
|
||||||
|
- ble cr7,L(ret0); \
|
||||||
|
- vextubrx r5,r6,vreg1; \
|
||||||
|
- vextubrx r4,r6,vreg2; \
|
||||||
|
- subf r3,r4,r5; \
|
||||||
|
- blr;
|
||||||
|
-
|
||||||
|
-#define CHECK_N_BYTES(reg1,reg2,len_reg) \
|
||||||
|
- sldi r6,len_reg,56; \
|
||||||
|
- lxvl 32+v4,reg1,r6; \
|
||||||
|
- lxvl 32+v5,reg2,r6; \
|
||||||
|
- add reg1,reg1,len_reg; \
|
||||||
|
- add reg2,reg2,len_reg; \
|
||||||
|
- vcmpnezb v7,v4,v5; \
|
||||||
|
- vctzlsbb r6,v7; \
|
||||||
|
- cmpld cr7,r6,len_reg; \
|
||||||
|
- blt cr7,L(different); \
|
||||||
|
- cmpld cr7,r5,len_reg; \
|
||||||
|
- ble cr7,L(ret0); \
|
||||||
|
- sub r5,r5,len_reg; \
|
||||||
|
-
|
||||||
|
- /* TODO: change this to .machine power10 when the minimum required
|
||||||
|
- binutils allows it. */
|
||||||
|
- .machine power9
|
||||||
|
-ENTRY_TOCLESS (STRNCMP, 4)
|
||||||
|
- /* Check if size is 0. */
|
||||||
|
- cmpdi cr0,r5,0
|
||||||
|
- beq cr0,L(ret0)
|
||||||
|
- andi. r7,r3,4095
|
||||||
|
- andi. r8,r4,4095
|
||||||
|
- cmpldi cr0,r7,4096-16
|
||||||
|
- cmpldi cr1,r8,4096-16
|
||||||
|
- bgt cr0,L(crosses)
|
||||||
|
- bgt cr1,L(crosses)
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- addi r3,r3,16
|
||||||
|
- addi r4,r4,16
|
||||||
|
-
|
||||||
|
-L(crosses):
|
||||||
|
- andi. r7,r3,15
|
||||||
|
- subfic r7,r7,16 /* r7(nalign1) = 16 - (str1 & 15). */
|
||||||
|
- andi. r9,r4,15
|
||||||
|
- subfic r8,r9,16 /* r8(nalign2) = 16 - (str2 & 15). */
|
||||||
|
- cmpld cr7,r7,r8
|
||||||
|
- beq cr7,L(same_aligned)
|
||||||
|
- blt cr7,L(nalign1_min)
|
||||||
|
-
|
||||||
|
- /* nalign2 is minimum and s2 pointer is aligned. */
|
||||||
|
- CHECK_N_BYTES(r3,r4,r8)
|
||||||
|
- /* Are we on the 64B hunk which crosses a page? */
|
||||||
|
- andi. r10,r3,63 /* Determine offset into 64B hunk. */
|
||||||
|
- andi. r8,r3,15 /* The offset into the 16B hunk. */
|
||||||
|
- neg r7,r3
|
||||||
|
- andi. r9,r7,15 /* Number of bytes after a 16B cross. */
|
||||||
|
- rlwinm. r7,r7,26,0x3F /* ((r4-4096))>>6&63. */
|
||||||
|
- beq L(compare_64_pagecross)
|
||||||
|
- mtctr r7
|
||||||
|
- b L(compare_64B_unaligned)
|
||||||
|
-
|
||||||
|
- /* nalign1 is minimum and s1 pointer is aligned. */
|
||||||
|
-L(nalign1_min):
|
||||||
|
- CHECK_N_BYTES(r3,r4,r7)
|
||||||
|
- /* Are we on the 64B hunk which crosses a page? */
|
||||||
|
- andi. r10,r4,63 /* Determine offset into 64B hunk. */
|
||||||
|
- andi. r8,r4,15 /* The offset into the 16B hunk. */
|
||||||
|
- neg r7,r4
|
||||||
|
- andi. r9,r7,15 /* Number of bytes after a 16B cross. */
|
||||||
|
- rlwinm. r7,r7,26,0x3F /* ((r4-4096))>>6&63. */
|
||||||
|
- beq L(compare_64_pagecross)
|
||||||
|
- mtctr r7
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(compare_64B_unaligned):
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- COMPARE_16(v4,v5,32)
|
||||||
|
- COMPARE_16(v4,v5,48)
|
||||||
|
- addi r3,r3,64
|
||||||
|
- addi r4,r4,64
|
||||||
|
- bdnz L(compare_64B_unaligned)
|
||||||
|
-
|
||||||
|
- /* Cross the page boundary of s2, carefully. Only for first
|
||||||
|
- iteration we have to get the count of 64B blocks to be checked.
|
||||||
|
- From second iteration and beyond, loop counter is always 63. */
|
||||||
|
-L(compare_64_pagecross):
|
||||||
|
- li r11, 63
|
||||||
|
- mtctr r11
|
||||||
|
- cmpldi r10,16
|
||||||
|
- ble L(cross_4)
|
||||||
|
- cmpldi r10,32
|
||||||
|
- ble L(cross_3)
|
||||||
|
- cmpldi r10,48
|
||||||
|
- ble L(cross_2)
|
||||||
|
-L(cross_1):
|
||||||
|
- CHECK_N_BYTES(r3,r4,r9)
|
||||||
|
- CHECK_N_BYTES(r3,r4,r8)
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- COMPARE_16(v4,v5,32)
|
||||||
|
- addi r3,r3,48
|
||||||
|
- addi r4,r4,48
|
||||||
|
- b L(compare_64B_unaligned)
|
||||||
|
-L(cross_2):
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- addi r3,r3,16
|
||||||
|
- addi r4,r4,16
|
||||||
|
- CHECK_N_BYTES(r3,r4,r9)
|
||||||
|
- CHECK_N_BYTES(r3,r4,r8)
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- addi r3,r3,32
|
||||||
|
- addi r4,r4,32
|
||||||
|
- b L(compare_64B_unaligned)
|
||||||
|
-L(cross_3):
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- addi r3,r3,32
|
||||||
|
- addi r4,r4,32
|
||||||
|
- CHECK_N_BYTES(r3,r4,r9)
|
||||||
|
- CHECK_N_BYTES(r3,r4,r8)
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- addi r3,r3,16
|
||||||
|
- addi r4,r4,16
|
||||||
|
- b L(compare_64B_unaligned)
|
||||||
|
-L(cross_4):
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- COMPARE_16(v4,v5,32)
|
||||||
|
- addi r3,r3,48
|
||||||
|
- addi r4,r4,48
|
||||||
|
- CHECK_N_BYTES(r3,r4,r9)
|
||||||
|
- CHECK_N_BYTES(r3,r4,r8)
|
||||||
|
- b L(compare_64B_unaligned)
|
||||||
|
-
|
||||||
|
-L(same_aligned):
|
||||||
|
- CHECK_N_BYTES(r3,r4,r7)
|
||||||
|
- /* Align s1 to 32B and adjust s2 address.
|
||||||
|
- Use lxvp only if both s1 and s2 are 32B aligned. */
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- COMPARE_16(v4,v5,32)
|
||||||
|
- COMPARE_16(v4,v5,48)
|
||||||
|
- addi r3,r3,64
|
||||||
|
- addi r4,r4,64
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- addi r5,r5,32
|
||||||
|
-
|
||||||
|
- clrldi r6,r3,59
|
||||||
|
- subfic r7,r6,32
|
||||||
|
- add r3,r3,r7
|
||||||
|
- add r4,r4,r7
|
||||||
|
- subf r5,r7,r5
|
||||||
|
- andi. r7,r4,0x1F
|
||||||
|
- beq cr0,L(32B_aligned_loop)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(16B_aligned_loop):
|
||||||
|
- COMPARE_16(v4,v5,0)
|
||||||
|
- COMPARE_16(v4,v5,16)
|
||||||
|
- COMPARE_16(v4,v5,32)
|
||||||
|
- COMPARE_16(v4,v5,48)
|
||||||
|
- addi r3,r3,64
|
||||||
|
- addi r4,r4,64
|
||||||
|
- b L(16B_aligned_loop)
|
||||||
|
-
|
||||||
|
- /* Calculate and return the difference. */
|
||||||
|
-L(different):
|
||||||
|
- TAIL_FIRST_16B(v4,v5)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(32B_aligned_loop):
|
||||||
|
- COMPARE_32(v14,v16,0,tail1,tail2)
|
||||||
|
- COMPARE_32(v18,v20,32,tail3,tail4)
|
||||||
|
- COMPARE_32(v22,v24,64,tail5,tail6)
|
||||||
|
- COMPARE_32(v26,v28,96,tail7,tail8)
|
||||||
|
- addi r3,r3,128
|
||||||
|
- addi r4,r4,128
|
||||||
|
- b L(32B_aligned_loop)
|
||||||
|
-
|
||||||
|
-L(tail1): TAIL_FIRST_16B(v15,v17)
|
||||||
|
-L(tail2): TAIL_SECOND_16B(v14,v16)
|
||||||
|
-L(tail3): TAIL_FIRST_16B(v19,v21)
|
||||||
|
-L(tail4): TAIL_SECOND_16B(v18,v20)
|
||||||
|
-L(tail5): TAIL_FIRST_16B(v23,v25)
|
||||||
|
-L(tail6): TAIL_SECOND_16B(v22,v24)
|
||||||
|
-L(tail7): TAIL_FIRST_16B(v27,v29)
|
||||||
|
-L(tail8): TAIL_SECOND_16B(v26,v28)
|
||||||
|
-
|
||||||
|
- .p2align 5
|
||||||
|
-L(ret0):
|
||||||
|
- li r3,0
|
||||||
|
- blr
|
||||||
|
-
|
||||||
|
-END(STRNCMP)
|
||||||
|
-libc_hidden_builtin_def(strncmp)
|
||||||
|
Index: glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/Makefile
|
||||||
|
===================================================================
|
||||||
|
--- glibc-2.41.orig/sysdeps/powerpc/powerpc64/multiarch/Makefile
|
||||||
|
+++ glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/Makefile
|
||||||
|
@@ -33,8 +33,8 @@ sysdep_routines += memcpy-power8-cached
|
||||||
|
ifneq (,$(filter %le,$(config-machine)))
|
||||||
|
sysdep_routines += memchr-power10 memcmp-power10 memcpy-power10 \
|
||||||
|
memmove-power10 memset-power10 rawmemchr-power9 \
|
||||||
|
- rawmemchr-power10 strcmp-power9 strcmp-power10 \
|
||||||
|
- strncmp-power9 strncmp-power10 strcpy-power9 strcat-power10 \
|
||||||
|
+ rawmemchr-power10 strcmp-power9 \
|
||||||
|
+ strncmp-power9 strcpy-power9 strcat-power10 \
|
||||||
|
stpcpy-power9 strlen-power9 strncpy-power9 stpncpy-power9 \
|
||||||
|
strlen-power10
|
||||||
|
endif
|
||||||
|
Index: glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
|
||||||
|
===================================================================
|
||||||
|
--- glibc-2.41.orig/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
|
||||||
|
+++ glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
|
||||||
|
@@ -164,9 +164,6 @@ __libc_ifunc_impl_list (const char *name
|
||||||
|
/* Support sysdeps/powerpc/powerpc64/multiarch/strncmp.c. */
|
||||||
|
IFUNC_IMPL (i, name, strncmp,
|
||||||
|
#ifdef __LITTLE_ENDIAN__
|
||||||
|
- IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_3_1
|
||||||
|
- && hwcap & PPC_FEATURE_HAS_VSX,
|
||||||
|
- __strncmp_power10)
|
||||||
|
IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_3_00
|
||||||
|
&& hwcap & PPC_FEATURE_HAS_ALTIVEC,
|
||||||
|
__strncmp_power9)
|
||||||
|
@@ -387,10 +384,6 @@ __libc_ifunc_impl_list (const char *name
|
||||||
|
IFUNC_IMPL (i, name, strcmp,
|
||||||
|
#ifdef __LITTLE_ENDIAN__
|
||||||
|
IFUNC_IMPL_ADD (array, i, strcmp,
|
||||||
|
- (hwcap2 & PPC_FEATURE2_ARCH_3_1)
|
||||||
|
- && (hwcap & PPC_FEATURE_HAS_VSX),
|
||||||
|
- __strcmp_power10)
|
||||||
|
- IFUNC_IMPL_ADD (array, i, strcmp,
|
||||||
|
hwcap2 & PPC_FEATURE2_ARCH_3_00
|
||||||
|
&& hwcap & PPC_FEATURE_HAS_ALTIVEC,
|
||||||
|
__strcmp_power9)
|
||||||
|
Index: glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/strcmp-power10.S
|
||||||
|
===================================================================
|
||||||
|
--- glibc-2.41.orig/sysdeps/powerpc/powerpc64/multiarch/strcmp-power10.S
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,26 +0,0 @@
|
||||||
|
-/* Optimized strcmp implementation for POWER10/PPC64.
|
||||||
|
- Copyright (C) 2021-2025 Free Software Foundation, Inc.
|
||||||
|
- This file is part of the GNU C Library.
|
||||||
|
-
|
||||||
|
- The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
- modify it under the terms of the GNU Lesser General Public
|
||||||
|
- License as published by the Free Software Foundation; either
|
||||||
|
- version 2.1 of the License, or (at your option) any later version.
|
||||||
|
-
|
||||||
|
- The GNU C Library is distributed in the hope that it will be useful,
|
||||||
|
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
- Lesser General Public License for more details.
|
||||||
|
-
|
||||||
|
- You should have received a copy of the GNU Lesser General Public
|
||||||
|
- License along with the GNU C Library; if not, see
|
||||||
|
- <https://www.gnu.org/licenses/>. */
|
||||||
|
-
|
||||||
|
-#if defined __LITTLE_ENDIAN__ && IS_IN (libc)
|
||||||
|
-#define STRCMP __strcmp_power10
|
||||||
|
-
|
||||||
|
-#undef libc_hidden_builtin_def
|
||||||
|
-#define libc_hidden_builtin_def(name)
|
||||||
|
-
|
||||||
|
-#include <sysdeps/powerpc/powerpc64/le/power10/strcmp.S>
|
||||||
|
-#endif /* __LITTLE_ENDIAN__ && IS_IN (libc) */
|
||||||
|
Index: glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
|
||||||
|
===================================================================
|
||||||
|
--- glibc-2.41.orig/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
|
||||||
|
+++ glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
|
||||||
|
@@ -29,16 +29,12 @@ extern __typeof (strcmp) __strcmp_power7
|
||||||
|
extern __typeof (strcmp) __strcmp_power8 attribute_hidden;
|
||||||
|
# ifdef __LITTLE_ENDIAN__
|
||||||
|
extern __typeof (strcmp) __strcmp_power9 attribute_hidden;
|
||||||
|
-extern __typeof (strcmp) __strcmp_power10 attribute_hidden;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# undef strcmp
|
||||||
|
|
||||||
|
libc_ifunc_redirected (__redirect_strcmp, strcmp,
|
||||||
|
# ifdef __LITTLE_ENDIAN__
|
||||||
|
- (hwcap2 & PPC_FEATURE2_ARCH_3_1
|
||||||
|
- && hwcap & PPC_FEATURE_HAS_VSX)
|
||||||
|
- ? __strcmp_power10 :
|
||||||
|
(hwcap2 & PPC_FEATURE2_ARCH_3_00
|
||||||
|
&& hwcap & PPC_FEATURE_HAS_ALTIVEC)
|
||||||
|
? __strcmp_power9 :
|
||||||
|
Index: glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/strncmp-power10.S
|
||||||
|
===================================================================
|
||||||
|
--- glibc-2.41.orig/sysdeps/powerpc/powerpc64/multiarch/strncmp-power10.S
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,25 +0,0 @@
|
||||||
|
-/* Copyright (C) 2024-2025 Free Software Foundation, Inc.
|
||||||
|
- This file is part of the GNU C Library.
|
||||||
|
-
|
||||||
|
- The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
- modify it under the terms of the GNU Lesser General Public
|
||||||
|
- License as published by the Free Software Foundation; either
|
||||||
|
- version 2.1 of the License, or (at your option) any later version.
|
||||||
|
-
|
||||||
|
- The GNU C Library is distributed in the hope that it will be useful,
|
||||||
|
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
- Lesser General Public License for more details.
|
||||||
|
-
|
||||||
|
- You should have received a copy of the GNU Lesser General Public
|
||||||
|
- License along with the GNU C Library; if not, see
|
||||||
|
- <https://www.gnu.org/licenses/>. */
|
||||||
|
-
|
||||||
|
-#if defined __LITTLE_ENDIAN__ && IS_IN (libc)
|
||||||
|
-#define STRNCMP __strncmp_power10
|
||||||
|
-
|
||||||
|
-#undef libc_hidden_builtin_def
|
||||||
|
-#define libc_hidden_builtin_def(name)
|
||||||
|
-
|
||||||
|
-#include <sysdeps/powerpc/powerpc64/le/power10/strncmp.S>
|
||||||
|
-#endif
|
||||||
|
Index: glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
|
||||||
|
===================================================================
|
||||||
|
--- glibc-2.41.orig/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
|
||||||
|
+++ glibc-2.41/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
|
||||||
|
@@ -29,7 +29,6 @@ extern __typeof (strncmp) __strncmp_ppc
|
||||||
|
extern __typeof (strncmp) __strncmp_power8 attribute_hidden;
|
||||||
|
# ifdef __LITTLE_ENDIAN__
|
||||||
|
extern __typeof (strncmp) __strncmp_power9 attribute_hidden;
|
||||||
|
-extern __typeof (strncmp) __strncmp_power10 attribute_hidden;
|
||||||
|
# endif
|
||||||
|
# undef strncmp
|
||||||
|
|
||||||
|
@@ -37,9 +36,6 @@ extern __typeof (strncmp) __strncmp_powe
|
||||||
|
ifunc symbol properly. */
|
||||||
|
libc_ifunc_redirected (__redirect_strncmp, strncmp,
|
||||||
|
# ifdef __LITTLE_ENDIAN__
|
||||||
|
- (hwcap2 & PPC_FEATURE2_ARCH_3_1
|
||||||
|
- && hwcap & PPC_FEATURE_HAS_VSX)
|
||||||
|
- ? __strncmp_power10 :
|
||||||
|
(hwcap2 & PPC_FEATURE2_ARCH_3_00
|
||||||
|
&& hwcap & PPC_FEATURE_HAS_ALTIVEC)
|
||||||
|
? __strncmp_power9 :
|
80
round-log10p1f.patch
Normal file
80
round-log10p1f.patch
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
From bdccbfbc52d3f6957768a0b9d5bd7bc4c90f2744 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||||
|
Date: Fri, 31 Jan 2025 10:27:39 -0300
|
||||||
|
Subject: [PATCH] math: Fix log10p1f internal table value (BZ 32626)
|
||||||
|
|
||||||
|
It was copied wrong from CORE-MATH.
|
||||||
|
|
||||||
|
(cherry picked from commit c79277a16785c8ae96d821414f4d31d654a0177c)
|
||||||
|
---
|
||||||
|
NEWS | 3 ++-
|
||||||
|
math/auto-libm-test-in | 2 ++
|
||||||
|
math/auto-libm-test-out-log10p1 | 25 +++++++++++++++++++++++++
|
||||||
|
sysdeps/ieee754/flt-32/s_log10p1f.c | 2 +-
|
||||||
|
4 files changed, 30 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in
|
||||||
|
index 01ba689aa8..c0627dc7eb 100644
|
||||||
|
--- a/math/auto-libm-test-in
|
||||||
|
+++ b/math/auto-libm-test-in
|
||||||
|
@@ -7291,6 +7291,8 @@ log10p1 -0x1p-125
|
||||||
|
log10p1 -0x1p-1021
|
||||||
|
log10p1 -0x1p-16381
|
||||||
|
|
||||||
|
+log10p1 0x1.27f7dap-17
|
||||||
|
+
|
||||||
|
log10p1 0x7.2a4368p-4
|
||||||
|
log10p1 0x6.d3a118p-4
|
||||||
|
log10p1 0x5.03f228p+0
|
||||||
|
diff --git a/math/auto-libm-test-out-log10p1 b/math/auto-libm-test-out-log10p1
|
||||||
|
index 87bdb0bcde..f5ce965720 100644
|
||||||
|
--- a/math/auto-libm-test-out-log10p1
|
||||||
|
+++ b/math/auto-libm-test-out-log10p1
|
||||||
|
@@ -1789,6 +1789,31 @@ log10p1 -0x1p-16381
|
||||||
|
= log10p1 tonearest binary128 -0x8p-16384 : -0x3.796f62a4dca1c654d56eaabeb4dp-16384 : inexact-ok underflow errno-erange-ok
|
||||||
|
= log10p1 towardzero binary128 -0x8p-16384 : -0x3.796f62a4dca1c654d56eaabeb4ccp-16384 : inexact-ok underflow errno-erange-ok
|
||||||
|
= log10p1 upward binary128 -0x8p-16384 : -0x3.796f62a4dca1c654d56eaabeb4ccp-16384 : inexact-ok underflow errno-erange-ok
|
||||||
|
+log10p1 0x1.27f7dap-17
|
||||||
|
+= log10p1 downward binary32 0x9.3fbedp-20 : 0x4.044b5p-20 : inexact-ok
|
||||||
|
+= log10p1 tonearest binary32 0x9.3fbedp-20 : 0x4.044b5p-20 : inexact-ok
|
||||||
|
+= log10p1 towardzero binary32 0x9.3fbedp-20 : 0x4.044b5p-20 : inexact-ok
|
||||||
|
+= log10p1 upward binary32 0x9.3fbedp-20 : 0x4.044b58p-20 : inexact-ok
|
||||||
|
+= log10p1 downward binary64 0x9.3fbedp-20 : 0x4.044b5157872ep-20 : inexact-ok
|
||||||
|
+= log10p1 tonearest binary64 0x9.3fbedp-20 : 0x4.044b5157872e4p-20 : inexact-ok
|
||||||
|
+= log10p1 towardzero binary64 0x9.3fbedp-20 : 0x4.044b5157872ep-20 : inexact-ok
|
||||||
|
+= log10p1 upward binary64 0x9.3fbedp-20 : 0x4.044b5157872e4p-20 : inexact-ok
|
||||||
|
+= log10p1 downward intel96 0x9.3fbedp-20 : 0x4.044b5157872e2868p-20 : inexact-ok
|
||||||
|
+= log10p1 tonearest intel96 0x9.3fbedp-20 : 0x4.044b5157872e2868p-20 : inexact-ok
|
||||||
|
+= log10p1 towardzero intel96 0x9.3fbedp-20 : 0x4.044b5157872e2868p-20 : inexact-ok
|
||||||
|
+= log10p1 upward intel96 0x9.3fbedp-20 : 0x4.044b5157872e287p-20 : inexact-ok
|
||||||
|
+= log10p1 downward m68k96 0x9.3fbedp-20 : 0x4.044b5157872e2868p-20 : inexact-ok
|
||||||
|
+= log10p1 tonearest m68k96 0x9.3fbedp-20 : 0x4.044b5157872e2868p-20 : inexact-ok
|
||||||
|
+= log10p1 towardzero m68k96 0x9.3fbedp-20 : 0x4.044b5157872e2868p-20 : inexact-ok
|
||||||
|
+= log10p1 upward m68k96 0x9.3fbedp-20 : 0x4.044b5157872e287p-20 : inexact-ok
|
||||||
|
+= log10p1 downward binary128 0x9.3fbedp-20 : 0x4.044b5157872e2868f5c04287d808p-20 : inexact-ok
|
||||||
|
+= log10p1 tonearest binary128 0x9.3fbedp-20 : 0x4.044b5157872e2868f5c04287d80cp-20 : inexact-ok
|
||||||
|
+= log10p1 towardzero binary128 0x9.3fbedp-20 : 0x4.044b5157872e2868f5c04287d808p-20 : inexact-ok
|
||||||
|
+= log10p1 upward binary128 0x9.3fbedp-20 : 0x4.044b5157872e2868f5c04287d80cp-20 : inexact-ok
|
||||||
|
+= log10p1 downward ibm128 0x9.3fbedp-20 : 0x4.044b5157872e2868f5c04287d8p-20 : inexact-ok
|
||||||
|
+= log10p1 tonearest ibm128 0x9.3fbedp-20 : 0x4.044b5157872e2868f5c04287d8p-20 : inexact-ok
|
||||||
|
+= log10p1 towardzero ibm128 0x9.3fbedp-20 : 0x4.044b5157872e2868f5c04287d8p-20 : inexact-ok
|
||||||
|
+= log10p1 upward ibm128 0x9.3fbedp-20 : 0x4.044b5157872e2868f5c04287dap-20 : inexact-ok
|
||||||
|
log10p1 0x7.2a4368p-4
|
||||||
|
= log10p1 downward binary32 0x7.2a4368p-4 : 0x2.9248dcp-4 : inexact-ok
|
||||||
|
= log10p1 tonearest binary32 0x7.2a4368p-4 : 0x2.9248ep-4 : inexact-ok
|
||||||
|
diff --git a/sysdeps/ieee754/flt-32/s_log10p1f.c b/sysdeps/ieee754/flt-32/s_log10p1f.c
|
||||||
|
index 64deb1eeda..4e11d55d49 100644
|
||||||
|
--- a/sysdeps/ieee754/flt-32/s_log10p1f.c
|
||||||
|
+++ b/sysdeps/ieee754/flt-32/s_log10p1f.c
|
||||||
|
@@ -70,7 +70,7 @@ __log10p1f (float x)
|
||||||
|
};
|
||||||
|
static const double tl[] =
|
||||||
|
{
|
||||||
|
- 0x1.562ec497ef351p-43, 0x1.b9476892ea99cp-8, 0x1.b5e909c959eecp-7,
|
||||||
|
+ -0x1.562ec497ef351p-43, 0x1.b9476892ea99cp-8, 0x1.b5e909c959eecp-7,
|
||||||
|
0x1.45f4f59ec84fp-6, 0x1.af5f92cbcf2aap-6, 0x1.0ba01a6069052p-5,
|
||||||
|
0x1.3ed119b99dd41p-5, 0x1.714834298a088p-5, 0x1.a30a9d98309c1p-5,
|
||||||
|
0x1.d41d51266b9d9p-5, 0x1.02428c0f62dfcp-4, 0x1.1a23444eea521p-4,
|
||||||
|
--
|
||||||
|
2.48.1
|
||||||
|
|
76
round-sinhf.patch
Normal file
76
round-sinhf.patch
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
From d85a7719536f4892f2b53d4594e18f6d096c2882 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||||
|
Date: Fri, 31 Jan 2025 10:34:32 -0300
|
||||||
|
Subject: [PATCH] math: Fix sinhf for some inputs (BZ 32627)
|
||||||
|
|
||||||
|
The logic was copied wrong from CORE-MATH.
|
||||||
|
---
|
||||||
|
math/auto-libm-test-in | 1 +
|
||||||
|
math/auto-libm-test-out-sinh | 25 +++++++++++++++++++++++++
|
||||||
|
sysdeps/ieee754/flt-32/e_sinhf.c | 2 +-
|
||||||
|
3 files changed, 27 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in
|
||||||
|
index c0627dc7eb..5f465b31f1 100644
|
||||||
|
--- a/math/auto-libm-test-in
|
||||||
|
+++ b/math/auto-libm-test-in
|
||||||
|
@@ -8300,6 +8300,7 @@ sinh -0x1.3dda8ap+0
|
||||||
|
sinh -0x5.ee9218p-4
|
||||||
|
sinh -0x1.bcfc98p+0
|
||||||
|
sinh -0x6.9bbb6df7c5d08p-4
|
||||||
|
+sinh 0x1.250bfep-11
|
||||||
|
# the next value generates larger error bounds on x86_64 (ldbl-96)
|
||||||
|
sinh 0x2.c5d376167f4052f4p+12
|
||||||
|
sinh max
|
||||||
|
diff --git a/math/auto-libm-test-out-sinh b/math/auto-libm-test-out-sinh
|
||||||
|
index 0b77a77eeb..3924e19d86 100644
|
||||||
|
--- a/math/auto-libm-test-out-sinh
|
||||||
|
+++ b/math/auto-libm-test-out-sinh
|
||||||
|
@@ -2115,6 +2115,31 @@ sinh -0x6.9bbb6df7c5d08p-4
|
||||||
|
= sinh tonearest ibm128 -0x6.9bbb6df7c5d08p-4 : -0x6.cc3ddf003dcda77f8f9e892e36p-4 : inexact-ok
|
||||||
|
= sinh towardzero ibm128 -0x6.9bbb6df7c5d08p-4 : -0x6.cc3ddf003dcda77f8f9e892e36p-4 : inexact-ok
|
||||||
|
= sinh upward ibm128 -0x6.9bbb6df7c5d08p-4 : -0x6.cc3ddf003dcda77f8f9e892e36p-4 : inexact-ok
|
||||||
|
+sinh 0x1.250bfep-11
|
||||||
|
+= sinh downward binary32 0x2.4a17fcp-12 : 0x2.4a17fcp-12 : inexact-ok
|
||||||
|
+= sinh tonearest binary32 0x2.4a17fcp-12 : 0x2.4a17fcp-12 : inexact-ok
|
||||||
|
+= sinh towardzero binary32 0x2.4a17fcp-12 : 0x2.4a17fcp-12 : inexact-ok
|
||||||
|
+= sinh upward binary32 0x2.4a17fcp-12 : 0x2.4a18p-12 : inexact-ok
|
||||||
|
+= sinh downward binary64 0x2.4a17fcp-12 : 0x2.4a17fdffffffep-12 : inexact-ok
|
||||||
|
+= sinh tonearest binary64 0x2.4a17fcp-12 : 0x2.4a17fep-12 : inexact-ok
|
||||||
|
+= sinh towardzero binary64 0x2.4a17fcp-12 : 0x2.4a17fdffffffep-12 : inexact-ok
|
||||||
|
+= sinh upward binary64 0x2.4a17fcp-12 : 0x2.4a17fep-12 : inexact-ok
|
||||||
|
+= sinh downward intel96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87cp-12 : inexact-ok
|
||||||
|
+= sinh tonearest intel96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff88p-12 : inexact-ok
|
||||||
|
+= sinh towardzero intel96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87cp-12 : inexact-ok
|
||||||
|
+= sinh upward intel96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff88p-12 : inexact-ok
|
||||||
|
+= sinh downward m68k96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87cp-12 : inexact-ok
|
||||||
|
+= sinh tonearest m68k96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff88p-12 : inexact-ok
|
||||||
|
+= sinh towardzero m68k96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87cp-12 : inexact-ok
|
||||||
|
+= sinh upward m68k96 0x2.4a17fcp-12 : 0x2.4a17fdfffffff88p-12 : inexact-ok
|
||||||
|
+= sinh downward binary128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786ec88p-12 : inexact-ok
|
||||||
|
+= sinh tonearest binary128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786ec8ap-12 : inexact-ok
|
||||||
|
+= sinh towardzero binary128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786ec88p-12 : inexact-ok
|
||||||
|
+= sinh upward binary128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786ec8ap-12 : inexact-ok
|
||||||
|
+= sinh downward ibm128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786ecp-12 : inexact-ok
|
||||||
|
+= sinh tonearest ibm128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786edp-12 : inexact-ok
|
||||||
|
+= sinh towardzero ibm128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786ecp-12 : inexact-ok
|
||||||
|
+= sinh upward ibm128 0x2.4a17fcp-12 : 0x2.4a17fdfffffff87e8d322786edp-12 : inexact-ok
|
||||||
|
sinh 0x2.c5d376167f4052f4p+12
|
||||||
|
= sinh downward binary32 0x2.c5d378p+12 : 0xf.fffffp+124 : inexact-ok overflow errno-erange-ok
|
||||||
|
= sinh tonearest binary32 0x2.c5d378p+12 : plus_infty : inexact-ok overflow errno-erange
|
||||||
|
diff --git a/sysdeps/ieee754/flt-32/e_sinhf.c b/sysdeps/ieee754/flt-32/e_sinhf.c
|
||||||
|
index c007c7d174..dee96fc7cb 100644
|
||||||
|
--- a/sysdeps/ieee754/flt-32/e_sinhf.c
|
||||||
|
+++ b/sysdeps/ieee754/flt-32/e_sinhf.c
|
||||||
|
@@ -83,7 +83,7 @@ __ieee754_sinhf (float x)
|
||||||
|
{ /* |x| <= 0x1.250bfep-11 */
|
||||||
|
if (__glibc_unlikely (ux < 0x66000000u)) /* |x| < 0x1p-24 */
|
||||||
|
return fmaf (x, fabsf (x), x);
|
||||||
|
- if (__glibc_unlikely (st.uarg == asuint (ux)))
|
||||||
|
+ if (__glibc_unlikely (st.uarg == ux))
|
||||||
|
{
|
||||||
|
float sgn = copysignf (1.0f, x);
|
||||||
|
return sgn * st.rh + sgn * st.rl;
|
||||||
|
--
|
||||||
|
2.48.1
|
||||||
|
|
79
round-tanf.patch
Normal file
79
round-tanf.patch
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
From cf88351b685da86667e17d344414a70696ac82f1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||||
|
Date: Sun, 2 Feb 2025 16:57:49 -0300
|
||||||
|
Subject: [PATCH] math: Fix tanf for some inputs (BZ 32630)
|
||||||
|
|
||||||
|
The logic was copied wrong from CORE-MATH.
|
||||||
|
|
||||||
|
(cherry picked from commit 09e7f4d594b4308fbea18e3044148d67b59757c9)
|
||||||
|
---
|
||||||
|
NEWS | 2 ++
|
||||||
|
math/auto-libm-test-in | 1 +
|
||||||
|
math/auto-libm-test-out-tan | 25 +++++++++++++++++++++++++
|
||||||
|
sysdeps/ieee754/flt-32/s_tanf.c | 2 +-
|
||||||
|
4 files changed, 29 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in
|
||||||
|
index 5f465b31f1..4f194da19d 100644
|
||||||
|
--- a/math/auto-libm-test-in
|
||||||
|
+++ b/math/auto-libm-test-in
|
||||||
|
@@ -8664,6 +8664,7 @@ tan 0x1.1ad374p+0
|
||||||
|
tan -0x1.0d55b8p+0
|
||||||
|
tan 1.57079697
|
||||||
|
tan -1.57079697
|
||||||
|
+tan 0x1.ada6aap+27
|
||||||
|
tan 0x1p-5
|
||||||
|
tan 0x1p-10
|
||||||
|
tan 0x1p-15
|
||||||
|
diff --git a/math/auto-libm-test-out-tan b/math/auto-libm-test-out-tan
|
||||||
|
index 7d00d03e1d..1d5999ab90 100644
|
||||||
|
--- a/math/auto-libm-test-out-tan
|
||||||
|
+++ b/math/auto-libm-test-out-tan
|
||||||
|
@@ -2532,6 +2532,31 @@ tan -1.57079697
|
||||||
|
= tan tonearest ibm128 -0x1.921fc00ece4f02f278ade6ad9fp+0 : 0x1.7b91a0851bbbafa14cf21c2b5c8p+20 : inexact-ok
|
||||||
|
= tan towardzero ibm128 -0x1.921fc00ece4f02f278ade6ad9fp+0 : 0x1.7b91a0851bbbafa14cf21c2b5cp+20 : inexact-ok
|
||||||
|
= tan upward ibm128 -0x1.921fc00ece4f02f278ade6ad9fp+0 : 0x1.7b91a0851bbbafa14cf21c2b5c8p+20 : inexact-ok
|
||||||
|
+tan 0x1.ada6aap+27
|
||||||
|
+= tan downward binary32 0xd.6d355p+24 : 0x3.d00608p-4 : inexact-ok
|
||||||
|
+= tan tonearest binary32 0xd.6d355p+24 : 0x3.d00608p-4 : inexact-ok
|
||||||
|
+= tan towardzero binary32 0xd.6d355p+24 : 0x3.d00608p-4 : inexact-ok
|
||||||
|
+= tan upward binary32 0xd.6d355p+24 : 0x3.d0060cp-4 : inexact-ok
|
||||||
|
+= tan downward binary64 0xd.6d355p+24 : 0x3.d00608p-4 : inexact-ok
|
||||||
|
+= tan tonearest binary64 0xd.6d355p+24 : 0x3.d00608p-4 : inexact-ok
|
||||||
|
+= tan towardzero binary64 0xd.6d355p+24 : 0x3.d00608p-4 : inexact-ok
|
||||||
|
+= tan upward binary64 0xd.6d355p+24 : 0x3.d006080000002p-4 : inexact-ok
|
||||||
|
+= tan downward intel96 0xd.6d355p+24 : 0x3.d006080000000504p-4 : inexact-ok
|
||||||
|
+= tan tonearest intel96 0xd.6d355p+24 : 0x3.d006080000000508p-4 : inexact-ok
|
||||||
|
+= tan towardzero intel96 0xd.6d355p+24 : 0x3.d006080000000504p-4 : inexact-ok
|
||||||
|
+= tan upward intel96 0xd.6d355p+24 : 0x3.d006080000000508p-4 : inexact-ok
|
||||||
|
+= tan downward m68k96 0xd.6d355p+24 : 0x3.d006080000000504p-4 : inexact-ok
|
||||||
|
+= tan tonearest m68k96 0xd.6d355p+24 : 0x3.d006080000000508p-4 : inexact-ok
|
||||||
|
+= tan towardzero m68k96 0xd.6d355p+24 : 0x3.d006080000000504p-4 : inexact-ok
|
||||||
|
+= tan upward m68k96 0xd.6d355p+24 : 0x3.d006080000000508p-4 : inexact-ok
|
||||||
|
+= tan downward binary128 0xd.6d355p+24 : 0x3.d0060800000005067d16c1c9c15ap-4 : inexact-ok
|
||||||
|
+= tan tonearest binary128 0xd.6d355p+24 : 0x3.d0060800000005067d16c1c9c15ap-4 : inexact-ok
|
||||||
|
+= tan towardzero binary128 0xd.6d355p+24 : 0x3.d0060800000005067d16c1c9c15ap-4 : inexact-ok
|
||||||
|
+= tan upward binary128 0xd.6d355p+24 : 0x3.d0060800000005067d16c1c9c15cp-4 : inexact-ok
|
||||||
|
+= tan downward ibm128 0xd.6d355p+24 : 0x3.d0060800000005067d16c1c9c1p-4 : inexact-ok
|
||||||
|
+= tan tonearest ibm128 0xd.6d355p+24 : 0x3.d0060800000005067d16c1c9c1p-4 : inexact-ok
|
||||||
|
+= tan towardzero ibm128 0xd.6d355p+24 : 0x3.d0060800000005067d16c1c9c1p-4 : inexact-ok
|
||||||
|
+= tan upward ibm128 0xd.6d355p+24 : 0x3.d0060800000005067d16c1c9c2p-4 : inexact-ok
|
||||||
|
tan 0x1p-5
|
||||||
|
= tan downward binary32 0x8p-8 : 0x8.00aabp-8 : inexact-ok
|
||||||
|
= tan tonearest binary32 0x8p-8 : 0x8.00aacp-8 : inexact-ok
|
||||||
|
diff --git a/sysdeps/ieee754/flt-32/s_tanf.c b/sysdeps/ieee754/flt-32/s_tanf.c
|
||||||
|
index dfe56fc2a0..5ee1d6f35e 100644
|
||||||
|
--- a/sysdeps/ieee754/flt-32/s_tanf.c
|
||||||
|
+++ b/sysdeps/ieee754/flt-32/s_tanf.c
|
||||||
|
@@ -166,7 +166,7 @@ __tanf (float x)
|
||||||
|
uint32_t sgn = t >> 31;
|
||||||
|
for (int j = 0; j < array_length (st); j++)
|
||||||
|
{
|
||||||
|
- if (__glibc_unlikely (asfloat (st[j].arg) == ax))
|
||||||
|
+ if (__glibc_unlikely (asuint (st[j].arg) == ax))
|
||||||
|
{
|
||||||
|
if (sgn)
|
||||||
|
return -st[j].rh - st[j].rl;
|
||||||
|
--
|
||||||
|
2.48.1
|
||||||
|
|
@@ -1,148 +0,0 @@
|
|||||||
From 02782fd12849b6673cb5c2728cb750e8ec295aa3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Stefan Liebler <stli@linux.ibm.com>
|
|
||||||
Date: Thu, 22 Feb 2024 15:03:27 +0100
|
|
||||||
Subject: [PATCH] S390: Do not clobber r7 in clone [BZ #31402]
|
|
||||||
|
|
||||||
Starting with commit e57d8fc97b90127de4ed3e3a9cdf663667580935
|
|
||||||
"S390: Always use svc 0"
|
|
||||||
clone clobbers the call-saved register r7 in error case:
|
|
||||||
function or stack is NULL.
|
|
||||||
|
|
||||||
This patch restores the saved registers also in the error case.
|
|
||||||
Furthermore the existing test misc/tst-clone is extended to check
|
|
||||||
all error cases and that clone does not clobber registers in this
|
|
||||||
error case.
|
|
||||||
---
|
|
||||||
sysdeps/unix/sysv/linux/s390/s390-32/clone.S | 1 +
|
|
||||||
sysdeps/unix/sysv/linux/s390/s390-64/clone.S | 1 +
|
|
||||||
sysdeps/unix/sysv/linux/tst-clone.c | 73 ++++++++++++++++----
|
|
||||||
3 files changed, 63 insertions(+), 12 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
|
|
||||||
index 4c882ef2ee..a7a863242c 100644
|
|
||||||
--- a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
|
|
||||||
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
|
|
||||||
@@ -53,6 +53,7 @@ ENTRY(__clone)
|
|
||||||
br %r14
|
|
||||||
error:
|
|
||||||
lhi %r2,-EINVAL
|
|
||||||
+ lm %r6,%r7,24(%r15) /* Load registers. */
|
|
||||||
j SYSCALL_ERROR_LABEL
|
|
||||||
PSEUDO_END (__clone)
|
|
||||||
|
|
||||||
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
|
|
||||||
index 4eb104be71..c552a6b8de 100644
|
|
||||||
--- a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
|
|
||||||
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
|
|
||||||
@@ -54,6 +54,7 @@ ENTRY(__clone)
|
|
||||||
br %r14
|
|
||||||
error:
|
|
||||||
lghi %r2,-EINVAL
|
|
||||||
+ lmg %r6,%r7,48(%r15) /* Restore registers. */
|
|
||||||
jg SYSCALL_ERROR_LABEL
|
|
||||||
PSEUDO_END (__clone)
|
|
||||||
|
|
||||||
diff --git a/sysdeps/unix/sysv/linux/tst-clone.c b/sysdeps/unix/sysv/linux/tst-clone.c
|
|
||||||
index 470676ab2b..2bc7124983 100644
|
|
||||||
--- a/sysdeps/unix/sysv/linux/tst-clone.c
|
|
||||||
+++ b/sysdeps/unix/sysv/linux/tst-clone.c
|
|
||||||
@@ -16,12 +16,16 @@
|
|
||||||
License along with the GNU C Library; if not, see
|
|
||||||
<https://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
-/* BZ #2386 */
|
|
||||||
+/* BZ #2386, BZ #31402 */
|
|
||||||
#include <errno.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <sched.h>
|
|
||||||
+#include <stackinfo.h> /* For _STACK_GROWS_{UP,DOWN}. */
|
|
||||||
+#include <support/check.h>
|
|
||||||
+
|
|
||||||
+volatile unsigned v = 0xdeadbeef;
|
|
||||||
|
|
||||||
int child_fn(void *arg)
|
|
||||||
{
|
|
||||||
@@ -30,22 +34,67 @@ int child_fn(void *arg)
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
-do_test (void)
|
|
||||||
+__attribute__((noinline))
|
|
||||||
+do_clone (int (*fn)(void *), void *stack)
|
|
||||||
{
|
|
||||||
int result;
|
|
||||||
+ unsigned int a = v;
|
|
||||||
+ unsigned int b = v;
|
|
||||||
+ unsigned int c = v;
|
|
||||||
+ unsigned int d = v;
|
|
||||||
+ unsigned int e = v;
|
|
||||||
+ unsigned int f = v;
|
|
||||||
+ unsigned int g = v;
|
|
||||||
+ unsigned int h = v;
|
|
||||||
+ unsigned int i = v;
|
|
||||||
+ unsigned int j = v;
|
|
||||||
+ unsigned int k = v;
|
|
||||||
+ unsigned int l = v;
|
|
||||||
+ unsigned int m = v;
|
|
||||||
+ unsigned int n = v;
|
|
||||||
+ unsigned int o = v;
|
|
||||||
+
|
|
||||||
+ result = clone (fn, stack, 0, NULL);
|
|
||||||
+
|
|
||||||
+ /* Check that clone does not clobber call-saved registers. */
|
|
||||||
+ TEST_VERIFY (a == v && b == v && c == v && d == v && e == v && f == v
|
|
||||||
+ && g == v && h == v && i == v && j == v && k == v && l == v
|
|
||||||
+ && m == v && n == v && o == v);
|
|
||||||
+
|
|
||||||
+ return result;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static void
|
|
||||||
+__attribute__((noinline))
|
|
||||||
+do_test_single (int (*fn)(void *), void *stack)
|
|
||||||
+{
|
|
||||||
+ printf ("%s (fn=%p, stack=%p)\n", __FUNCTION__, fn, stack);
|
|
||||||
+ errno = 0;
|
|
||||||
+
|
|
||||||
+ int result = do_clone (fn, stack);
|
|
||||||
+
|
|
||||||
+ TEST_COMPARE (errno, EINVAL);
|
|
||||||
+ TEST_COMPARE (result, -1);
|
|
||||||
+}
|
|
||||||
|
|
||||||
- result = clone (child_fn, NULL, 0, NULL);
|
|
||||||
+static int
|
|
||||||
+do_test (void)
|
|
||||||
+{
|
|
||||||
+ char st[128 * 1024] __attribute__ ((aligned));
|
|
||||||
+ void *stack = NULL;
|
|
||||||
+#if _STACK_GROWS_DOWN
|
|
||||||
+ stack = st + sizeof (st);
|
|
||||||
+#elif _STACK_GROWS_UP
|
|
||||||
+ stack = st;
|
|
||||||
+#else
|
|
||||||
+# error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
- if (errno != EINVAL || result != -1)
|
|
||||||
- {
|
|
||||||
- printf ("FAIL: clone()=%d (wanted -1) errno=%d (wanted %d)\n",
|
|
||||||
- result, errno, EINVAL);
|
|
||||||
- return 1;
|
|
||||||
- }
|
|
||||||
+ do_test_single (child_fn, NULL);
|
|
||||||
+ do_test_single (NULL, stack);
|
|
||||||
+ do_test_single (NULL, NULL);
|
|
||||||
|
|
||||||
- puts ("All OK");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
-#define TEST_FUNCTION do_test ()
|
|
||||||
-#include "../test-skeleton.c"
|
|
||||||
+#include <support/test-driver.c>
|
|
||||||
--
|
|
||||||
2.44.0
|
|
||||||
|
|
@@ -1,128 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
@@ -1,75 +0,0 @@
|
|||||||
#
|
|
||||||
# /etc/nsswitch.conf
|
|
||||||
#
|
|
||||||
# An example Name Service Switch config file. This file should be
|
|
||||||
# sorted with the most-used services at the beginning.
|
|
||||||
#
|
|
||||||
# Valid databases are: aliases, ethers, group, gshadow, hosts,
|
|
||||||
# initgroups, netgroup, networks, passwd, protocols, publickey,
|
|
||||||
# rpc, services, and shadow.
|
|
||||||
#
|
|
||||||
# Valid service provider entries include (in alphabetical order):
|
|
||||||
#
|
|
||||||
# compat Use /etc files plus *_compat pseudo-db
|
|
||||||
# db Use the pre-processed /var/db files
|
|
||||||
# dns Use DNS (Domain Name Service)
|
|
||||||
# files Use the local files in /etc
|
|
||||||
# hesiod Use Hesiod (DNS) for user lookups
|
|
||||||
# nis Use NIS (NIS version 2), also called YP
|
|
||||||
# nisplus Use NIS+ (NIS version 3)
|
|
||||||
#
|
|
||||||
# See `info libc 'NSS Basics'` for more information.
|
|
||||||
#
|
|
||||||
# Commonly used alternative service providers (may need installation):
|
|
||||||
#
|
|
||||||
# ldap Use LDAP directory server
|
|
||||||
# myhostname Use systemd host names
|
|
||||||
# mymachines Use systemd machine names
|
|
||||||
# mdns*, mdns*_minimal Use Avahi mDNS/DNS-SD
|
|
||||||
# resolve Use systemd resolved resolver
|
|
||||||
# sss Use System Security Services Daemon (sssd)
|
|
||||||
# systemd Use systemd for dynamic user option
|
|
||||||
# winbind Use Samba winbind support
|
|
||||||
# wins Use Samba wins support
|
|
||||||
# wrapper Use wrapper module for testing
|
|
||||||
#
|
|
||||||
# Notes:
|
|
||||||
#
|
|
||||||
# 'sssd' performs its own 'files'-based caching, so it should generally
|
|
||||||
# come before 'files'.
|
|
||||||
#
|
|
||||||
# WARNING: Running nscd with a secondary caching service like sssd may
|
|
||||||
# lead to unexpected behaviour, especially with how long
|
|
||||||
# entries are cached.
|
|
||||||
#
|
|
||||||
# Installation instructions:
|
|
||||||
#
|
|
||||||
# To use 'db', install the appropriate package(s) (provide 'makedb' and
|
|
||||||
# libnss_db.so.*), and place the 'db' in front of 'files' for entries
|
|
||||||
# you want to be looked up first in the databases, like this:
|
|
||||||
#
|
|
||||||
# passwd: db files
|
|
||||||
# shadow: db files
|
|
||||||
# group: db files
|
|
||||||
|
|
||||||
passwd: compat
|
|
||||||
group: compat
|
|
||||||
shadow: compat
|
|
||||||
# Allow initgroups to default to the setting for group.
|
|
||||||
# initgroups: compat
|
|
||||||
|
|
||||||
hosts: files dns
|
|
||||||
networks: files dns
|
|
||||||
|
|
||||||
aliases: files usrfiles
|
|
||||||
ethers: files usrfiles
|
|
||||||
gshadow: files usrfiles
|
|
||||||
netgroup: files nis
|
|
||||||
protocols: files usrfiles
|
|
||||||
publickey: files
|
|
||||||
rpc: files usrfiles
|
|
||||||
services: files usrfiles
|
|
||||||
|
|
||||||
automount: files nis
|
|
||||||
bootparams: files
|
|
||||||
netmasks: files
|
|
File diff suppressed because it is too large
Load Diff
37
tst-aarch64-pkey.patch
Normal file
37
tst-aarch64-pkey.patch
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
From 1e0e33e1b19a7634b364ac7b97c3c9612d5b776f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Aurelien Jarno <aurelien@aurel32.net>
|
||||||
|
Date: Sat, 15 Feb 2025 11:08:33 +0100
|
||||||
|
Subject: [PATCH] Fix tst-aarch64-pkey to handle ENOSPC as not supported
|
||||||
|
|
||||||
|
The syscall pkey_alloc can return ENOSPC to indicate either that all
|
||||||
|
keys are in use or that the system runs in a mode in which memory
|
||||||
|
protection keys are disabled. In such case the test should not fail and
|
||||||
|
just return unsupported.
|
||||||
|
|
||||||
|
This matches the behaviour of the generic tst-pkey.
|
||||||
|
|
||||||
|
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||||
|
Reviewed-by: Florian Weimer <fweimer@redhat.com>
|
||||||
|
(cherry picked from commit 60f2d6be657aa8c663ee14bd266d343ae0f35afb)
|
||||||
|
---
|
||||||
|
sysdeps/unix/sysv/linux/aarch64/tst-aarch64-pkey.c | 4 ++++
|
||||||
|
1 file changed, 4 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-aarch64-pkey.c b/sysdeps/unix/sysv/linux/aarch64/tst-aarch64-pkey.c
|
||||||
|
index 3ff33ef72a..c884efc3b4 100644
|
||||||
|
--- a/sysdeps/unix/sysv/linux/aarch64/tst-aarch64-pkey.c
|
||||||
|
+++ b/sysdeps/unix/sysv/linux/aarch64/tst-aarch64-pkey.c
|
||||||
|
@@ -55,6 +55,10 @@ do_test (void)
|
||||||
|
if (errno == ENOSYS || errno == EINVAL)
|
||||||
|
FAIL_UNSUPPORTED
|
||||||
|
("kernel or CPU does not support memory protection keys");
|
||||||
|
+ if (errno == ENOSPC)
|
||||||
|
+ FAIL_UNSUPPORTED
|
||||||
|
+ ("no keys available or kernel does not support memory"
|
||||||
|
+ " protection keys");
|
||||||
|
FAIL_EXIT1 ("pkey_alloc: %m");
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.48.1
|
||||||
|
|
@@ -1,6 +1,6 @@
|
|||||||
From ec4f0a28ed48c51165e3e72c7427efb0ae14a124 Mon Sep 17 00:00:00 2001
|
From 43c311457caf71c02ea2857bcf4e1e0499dc221a Mon Sep 17 00:00:00 2001
|
||||||
From: Giuliano Belinassi <gbelinassi@suse.de>
|
From: Giuliano Belinassi <gbelinassi@suse.de>
|
||||||
Date: Mon, 6 May 2024 20:09:55 -0300
|
Date: Fri, 18 Apr 2025 14:22:49 -0300
|
||||||
Subject: [PATCH] Add Userspace Livepatch prologue into ASM functions
|
Subject: [PATCH] Add Userspace Livepatch prologue into ASM functions
|
||||||
|
|
||||||
Userspace Live Patching (ULP) refers to the process of applying
|
Userspace Live Patching (ULP) refers to the process of applying
|
||||||
@@ -12,38 +12,24 @@ this have to be included manually. This patch does this.
|
|||||||
|
|
||||||
Signed-off-by: Giuliano Belinassi <gbelinassi@suse.de>
|
Signed-off-by: Giuliano Belinassi <gbelinassi@suse.de>
|
||||||
---
|
---
|
||||||
Makeconfig | 5 +++
|
|
||||||
config.h.in | 3 ++
|
config.h.in | 3 ++
|
||||||
config.make.in | 1 +
|
config.make.in | 2 +
|
||||||
configure | 21 +++++++++
|
configure | 54 +++++++++++++++++++++++
|
||||||
configure.ac | 13 ++++++
|
configure.ac | 29 +++++++++++++
|
||||||
|
sysdeps/powerpc/powerpc64/le/Makefile | 8 ++++
|
||||||
|
sysdeps/powerpc/powerpc64/sysdep.h | 55 ++++++++++++++++++++++--
|
||||||
|
sysdeps/x86_64/Makefile | 5 +++
|
||||||
sysdeps/x86_64/multiarch/strcmp-avx2.S | 5 +--
|
sysdeps/x86_64/multiarch/strcmp-avx2.S | 5 +--
|
||||||
sysdeps/x86_64/multiarch/strcmp-evex.S | 5 +--
|
sysdeps/x86_64/multiarch/strcmp-evex.S | 5 +--
|
||||||
sysdeps/x86_64/multiarch/strcmp-sse4_2.S | 5 +--
|
sysdeps/x86_64/multiarch/strcmp-sse4_2.S | 5 +--
|
||||||
sysdeps/x86_64/sysdep.h | 54 ++++++++++++++++++++++--
|
sysdeps/x86_64/sysdep.h | 54 +++++++++++++++++++++--
|
||||||
9 files changed, 96 insertions(+), 16 deletions(-)
|
11 files changed, 205 insertions(+), 20 deletions(-)
|
||||||
|
|
||||||
diff --git a/Makeconfig b/Makeconfig
|
|
||||||
index e583765712..b136e10224 100644
|
|
||||||
--- a/Makeconfig
|
|
||||||
+++ b/Makeconfig
|
|
||||||
@@ -981,6 +981,11 @@ else
|
|
||||||
+cflags += $(no-fortify-source)
|
|
||||||
endif
|
|
||||||
|
|
||||||
+# Add flags for Userspace Livepatching support.
|
|
||||||
+ifeq (yes,$(enable-userspace-livepatch))
|
|
||||||
++cflags += -fpatchable-function-entry=16,14
|
|
||||||
+endif
|
|
||||||
+
|
|
||||||
# Each sysdeps directory can contain header files that both will be
|
|
||||||
# used to compile and will be installed. Each can also contain an
|
|
||||||
# include/ subdirectory, whose header files will be used to compile
|
|
||||||
diff --git a/config.h.in b/config.h.in
|
diff --git a/config.h.in b/config.h.in
|
||||||
index c4cc7d3b9a..dc70ed03d0 100644
|
index cdbd555366..2cd9838361 100644
|
||||||
--- a/config.h.in
|
--- a/config.h.in
|
||||||
+++ b/config.h.in
|
+++ b/config.h.in
|
||||||
@@ -205,6 +205,9 @@
|
@@ -221,6 +221,9 @@
|
||||||
/* Define to 1 if libpthread actually resides in libc. */
|
/* Define to 1 if libpthread actually resides in libc. */
|
||||||
#define PTHREAD_IN_LIBC 0
|
#define PTHREAD_IN_LIBC 0
|
||||||
|
|
||||||
@@ -54,30 +40,32 @@ index c4cc7d3b9a..dc70ed03d0 100644
|
|||||||
#define TIMEOUTFACTOR 1
|
#define TIMEOUTFACTOR 1
|
||||||
|
|
||||||
diff --git a/config.make.in b/config.make.in
|
diff --git a/config.make.in b/config.make.in
|
||||||
index 55e8b7563b..0f14c05d62 100644
|
index 59897eaec2..63f9b6ee58 100644
|
||||||
--- a/config.make.in
|
--- a/config.make.in
|
||||||
+++ b/config.make.in
|
+++ b/config.make.in
|
||||||
@@ -81,6 +81,7 @@ mach-interface-list = @mach_interface_list@
|
@@ -82,6 +82,8 @@ mach-interface-list = @mach_interface_list@
|
||||||
memory-tagging = @memory_tagging@
|
memory-tagging = @memory_tagging@
|
||||||
|
|
||||||
# Configuration options.
|
# Configuration options.
|
||||||
+enable-userspace-livepatch = @enable_userspace_livepatch@
|
+enable-userspace-livepatch = @enable_userspace_livepatch@
|
||||||
|
+supports-msplit-patch-nops = @supports_msplit_patch_nops@
|
||||||
build-shared = @shared@
|
build-shared = @shared@
|
||||||
build-profile = @profile@
|
build-profile = @profile@
|
||||||
build-static-nss = @static_nss@
|
build-static-nss = @static_nss@
|
||||||
diff --git a/configure b/configure
|
diff --git a/configure b/configure
|
||||||
index 432e40a592..eb6b203925 100755
|
index 674d1d7e4a..51dbce3b34 100755
|
||||||
--- a/configure
|
--- a/configure
|
||||||
+++ b/configure
|
+++ b/configure
|
||||||
@@ -622,6 +622,7 @@ LIBOBJS
|
@@ -615,6 +615,8 @@ LIBOBJS
|
||||||
pthread_in_libc
|
pthread_in_libc
|
||||||
RELEASE
|
RELEASE
|
||||||
VERSION
|
VERSION
|
||||||
|
+supports_msplit_patch_nops
|
||||||
+enable_userspace_livepatch
|
+enable_userspace_livepatch
|
||||||
mach_interface_list
|
mach_interface_list
|
||||||
DEFINES
|
DEFINES
|
||||||
static_nss
|
static_nss
|
||||||
@@ -812,6 +813,7 @@ enable_cet
|
@@ -821,6 +823,7 @@ enable_cet
|
||||||
enable_scv
|
enable_scv
|
||||||
enable_fortify_source
|
enable_fortify_source
|
||||||
with_cpu
|
with_cpu
|
||||||
@@ -85,7 +73,7 @@ index 432e40a592..eb6b203925 100755
|
|||||||
'
|
'
|
||||||
ac_precious_vars='build_alias
|
ac_precious_vars='build_alias
|
||||||
host_alias
|
host_alias
|
||||||
@@ -1490,6 +1492,8 @@ Optional Features:
|
@@ -1505,6 +1508,8 @@ Optional Features:
|
||||||
Use -D_FORTIFY_SOURCE=[1|2|3] to control code
|
Use -D_FORTIFY_SOURCE=[1|2|3] to control code
|
||||||
hardening, defaults to highest possible value
|
hardening, defaults to highest possible value
|
||||||
supported by the build compiler.
|
supported by the build compiler.
|
||||||
@@ -94,7 +82,7 @@ index 432e40a592..eb6b203925 100755
|
|||||||
|
|
||||||
Optional Packages:
|
Optional Packages:
|
||||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||||
@@ -7867,6 +7871,23 @@ libc_cv_multidir=`${CC-cc} $CFLAGS $CPPFLAGS -print-multi-directory`
|
@@ -9152,6 +9157,55 @@ libc_cv_multidir=`${CC-cc} $CFLAGS $CPPFLAGS -print-multi-directory`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -102,11 +90,42 @@ index 432e40a592..eb6b203925 100755
|
|||||||
+if test ${enable_userspace_livepatch+y}
|
+if test ${enable_userspace_livepatch+y}
|
||||||
+then :
|
+then :
|
||||||
+ enableval=$enable_userspace_livepatch; enable_userspace_livepatch=$enableval
|
+ enableval=$enable_userspace_livepatch; enable_userspace_livepatch=$enableval
|
||||||
+else $as_nop
|
+else case e in #(
|
||||||
+ enable_userspace_livepatch=no
|
+ e) enable_userspace_livepatch=no ;;
|
||||||
|
+esac
|
||||||
+fi
|
+fi
|
||||||
+
|
+
|
||||||
+
|
+
|
||||||
|
+# Check if compiler provides -msplit-patch-nops. It may be required on
|
||||||
|
+# some architectures for livepatching support.
|
||||||
|
+if test "x$enable_userspace_livepatch" = xyes; then
|
||||||
|
+ old_CFLAGS="$CFLAGS"
|
||||||
|
+ CFLAGS="-msplit-patch-nops $CFLAGS"
|
||||||
|
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
+/* end confdefs.h. */
|
||||||
|
+extern void g(void);
|
||||||
|
+ __attribute__((patchable_function_entry(14, 13)))
|
||||||
|
+ void f(void) { g(); }
|
||||||
|
+int
|
||||||
|
+main (void)
|
||||||
|
+{
|
||||||
|
+
|
||||||
|
+ ;
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+_ACEOF
|
||||||
|
+if ac_fn_c_try_compile "$LINENO"
|
||||||
|
+then :
|
||||||
|
+ supports_msplit_patch_nops=yes
|
||||||
|
+else case e in #(
|
||||||
|
+ e) supports_msplit_patch_nops=no ;;
|
||||||
|
+esac
|
||||||
|
+fi
|
||||||
|
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||||
|
+
|
||||||
|
+ CFLAGS="$old_CFLAGS"
|
||||||
|
+fi
|
||||||
|
+
|
||||||
+# Libpulp uses -fpatchable-function-entry to add padding NOPS to the
|
+# Libpulp uses -fpatchable-function-entry to add padding NOPS to the
|
||||||
+# prologue of all functions.
|
+# prologue of all functions.
|
||||||
+if test "x$enable_userspace_livepatch" = xyes; then
|
+if test "x$enable_userspace_livepatch" = xyes; then
|
||||||
@@ -114,15 +133,16 @@ index 432e40a592..eb6b203925 100755
|
|||||||
+
|
+
|
||||||
+fi
|
+fi
|
||||||
+
|
+
|
||||||
|
+
|
||||||
+
|
+
|
||||||
VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
|
VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
|
||||||
RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
|
RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
|
||||||
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
diff --git a/configure.ac b/configure.ac
|
||||||
index bdc385d03c..cb4d28b3d8 100644
|
index 57cd24c87d..97c65dc6c5 100644
|
||||||
--- a/configure.ac
|
--- a/configure.ac
|
||||||
+++ b/configure.ac
|
+++ b/configure.ac
|
||||||
@@ -1756,6 +1756,19 @@ AC_SUBST(DEFINES)
|
@@ -2079,6 +2079,35 @@ AC_SUBST(DEFINES)
|
||||||
dnl See sysdeps/mach/configure.ac for this variable.
|
dnl See sysdeps/mach/configure.ac for this variable.
|
||||||
AC_SUBST(mach_interface_list)
|
AC_SUBST(mach_interface_list)
|
||||||
|
|
||||||
@@ -132,18 +152,145 @@ index bdc385d03c..cb4d28b3d8 100644
|
|||||||
+ [enable_userspace_livepatch=$enableval],
|
+ [enable_userspace_livepatch=$enableval],
|
||||||
+ [enable_userspace_livepatch=no])
|
+ [enable_userspace_livepatch=no])
|
||||||
+
|
+
|
||||||
|
+# Check if compiler provides -msplit-patch-nops. It may be required on
|
||||||
|
+# some architectures for livepatching support.
|
||||||
|
+if test "x$enable_userspace_livepatch" = xyes; then
|
||||||
|
+ old_CFLAGS="$CFLAGS"
|
||||||
|
+ CFLAGS="-msplit-patch-nops $CFLAGS"
|
||||||
|
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
||||||
|
+ [[extern void g(void);
|
||||||
|
+ __attribute__((patchable_function_entry(14, 13)))
|
||||||
|
+ void f(void) { g(); }]])],
|
||||||
|
+ [supports_msplit_patch_nops=yes],
|
||||||
|
+ [supports_msplit_patch_nops=no])
|
||||||
|
+
|
||||||
|
+ CFLAGS="$old_CFLAGS"
|
||||||
|
+fi
|
||||||
|
+
|
||||||
+# Libpulp uses -fpatchable-function-entry to add padding NOPS to the
|
+# Libpulp uses -fpatchable-function-entry to add padding NOPS to the
|
||||||
+# prologue of all functions.
|
+# prologue of all functions.
|
||||||
+if test "x$enable_userspace_livepatch" = xyes; then
|
+if test "x$enable_userspace_livepatch" = xyes; then
|
||||||
+ AC_DEFINE(ENABLE_USERSPACE_LIVEPATCH)
|
+ AC_DEFINE(ENABLE_USERSPACE_LIVEPATCH)
|
||||||
+fi
|
+fi
|
||||||
+AC_SUBST(enable_userspace_livepatch)
|
+AC_SUBST(enable_userspace_livepatch)
|
||||||
|
+AC_SUBST(supports_msplit_patch_nops)
|
||||||
+
|
+
|
||||||
VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
|
VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
|
||||||
RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
|
RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
|
||||||
AC_SUBST(VERSION)
|
AC_SUBST(VERSION)
|
||||||
|
diff --git a/sysdeps/powerpc/powerpc64/le/Makefile b/sysdeps/powerpc/powerpc64/le/Makefile
|
||||||
|
index b77775cf95..8340a8e02f 100644
|
||||||
|
--- a/sysdeps/powerpc/powerpc64/le/Makefile
|
||||||
|
+++ b/sysdeps/powerpc/powerpc64/le/Makefile
|
||||||
|
@@ -1,3 +1,11 @@
|
||||||
|
+# Add flags for Userspace Livepatching support.
|
||||||
|
+ifeq (yes,$(enable-userspace-livepatch))
|
||||||
|
++cflags += -fpatchable-function-entry=14,13
|
||||||
|
+ifeq (yes,$(supports-msplit-patch-nops))
|
||||||
|
++cflags += -msplit-patch-nops
|
||||||
|
+endif
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
# When building float128 we need to ensure -mfloat128 is
|
||||||
|
# passed to all such object files.
|
||||||
|
type-float128-CFLAGS := -mfloat128
|
||||||
|
diff --git a/sysdeps/powerpc/powerpc64/sysdep.h b/sysdeps/powerpc/powerpc64/sysdep.h
|
||||||
|
index f05dae71f6..55c6b9b45b 100644
|
||||||
|
--- a/sysdeps/powerpc/powerpc64/sysdep.h
|
||||||
|
+++ b/sysdeps/powerpc/powerpc64/sysdep.h
|
||||||
|
@@ -163,6 +163,46 @@
|
||||||
|
BODY_LABEL(\name):
|
||||||
|
.endm
|
||||||
|
|
||||||
|
+/* Libpulp uses -fpatchable-function-entry to add padding NOPS to the
|
||||||
|
+ prologue of all functions. This works for C functions. For functions
|
||||||
|
+ written in ASM, the way we do this is by adding this prologue manually. */
|
||||||
|
+
|
||||||
|
+#if ENABLE_USERSPACE_LIVEPATCH
|
||||||
|
+
|
||||||
|
+/* Instructions to be inserted before the function label. */
|
||||||
|
+# define ULP_NOPS_PRE_PROLOGUE .rept 13; nop; .endr
|
||||||
|
+
|
||||||
|
+/* Instruction to be inserted after the function label. */
|
||||||
|
+# define ULP_NOPS_POST_PROLOGUE .rept 1; nop; .endr
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+/* this macro expands according to the following condition:
|
||||||
|
+ * if name = _start, then the prologue is not inserted.
|
||||||
|
+ * if name = _dl_relocate_static_pie, then the prologue is not inserted.
|
||||||
|
+ * if name = anything else, then the prologue is inserted.
|
||||||
|
+ **/
|
||||||
|
+# define __ULP_PRE_PROLOGUE_dl_relocate_static_pie ,
|
||||||
|
+# define __ULP_PRE_PROLOGUE_start ,
|
||||||
|
+# define __ULP_PRE_PROLOGUE(x, y,...) y
|
||||||
|
+# define _ULP_PRE_PROLOGUE(x, ...) __ULP_PRE_PROLOGUE(x, __VA_ARGS__)
|
||||||
|
+# define ULP_PRE_PROLOGUE(name) _ULP_PRE_PROLOGUE(__ULP_PRE_PROLOGUE##name, ULP_NOPS_PRE_PROLOGUE,)
|
||||||
|
+
|
||||||
|
+/* this macro expands according to the following condition:
|
||||||
|
+ * if name = _start, then the postlogue is not inserted.
|
||||||
|
+ * if name = _dl_relocate_static_pie, then the postlogue is not inserted.
|
||||||
|
+ * if name = anything else, then the postlogue is inserted.
|
||||||
|
+ **/
|
||||||
|
+# define __ULP_POST_PROLOGUE_dl_relocate_static_pie ,
|
||||||
|
+# define __ULP_POST_PROLOGUE_start ,
|
||||||
|
+# define __ULP_POST_PROLOGUE(x, y,...) y
|
||||||
|
+# define _ULP_POST_PROLOGUE(x, ...) __ULP_POST_PROLOGUE(x, __VA_ARGS__)
|
||||||
|
+# define ULP_POST_PROLOGUE(name) _ULP_POST_PROLOGUE(__ULP_POST_PROLOGUE##name, ULP_NOPS_POST_PROLOGUE,)
|
||||||
|
+
|
||||||
|
+#else
|
||||||
|
+# define ULP_PRE_PROLOGUE(name)
|
||||||
|
+# define ULP_POST_PROLOGUE(name)
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/* Use ENTRY_TOCLESS for functions that make no use of r2 and
|
||||||
|
guarantee r2 is unchanged on exit. Any function that has @toc or
|
||||||
|
@got relocs uses r2. Functions that call other functions via the
|
||||||
|
@@ -175,19 +215,26 @@ BODY_LABEL(\name):
|
||||||
|
before the start of the function's code. */
|
||||||
|
#ifndef PROF
|
||||||
|
#define ENTRY_TOCLESS(name, ...) \
|
||||||
|
+ ULP_PRE_PROLOGUE(name); \
|
||||||
|
ENTRY_3 name, ## __VA_ARGS__; \
|
||||||
|
- cfi_startproc
|
||||||
|
+ cfi_startproc; \
|
||||||
|
+ ULP_POST_PROLOGUE(name)
|
||||||
|
|
||||||
|
#define ENTRY(name, ...) \
|
||||||
|
- ENTRY_TOCLESS(name, ## __VA_ARGS__); \
|
||||||
|
- LOCALENTRY(name)
|
||||||
|
+ ULP_PRE_PROLOGUE(name); \
|
||||||
|
+ ENTRY_3 name, ## __VA_ARGS__; \
|
||||||
|
+ cfi_startproc; \
|
||||||
|
+ LOCALENTRY(name); \
|
||||||
|
+ ULP_POST_PROLOGUE(name)
|
||||||
|
#else
|
||||||
|
/* The call to _mcount is potentially via the plt, so profiling code
|
||||||
|
is never free of an r2 use. */
|
||||||
|
#define ENTRY_TOCLESS(name, ...) \
|
||||||
|
+ ULP_PRE_PROLOGUE(name); \
|
||||||
|
ENTRY_3 name, ## __VA_ARGS__; \
|
||||||
|
cfi_startproc; \
|
||||||
|
- LOCALENTRY(name)
|
||||||
|
+ LOCALENTRY(name); \
|
||||||
|
+ ULP_POST_PROLOGUE(name)
|
||||||
|
|
||||||
|
#define ENTRY(name, ...) \
|
||||||
|
ENTRY_TOCLESS(name, ## __VA_ARGS__)
|
||||||
|
diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
|
||||||
|
index 9d31685e02..d20287a050 100644
|
||||||
|
--- a/sysdeps/x86_64/Makefile
|
||||||
|
+++ b/sysdeps/x86_64/Makefile
|
||||||
|
@@ -1,3 +1,8 @@
|
||||||
|
+# Add flags for Userspace Livepatching support.
|
||||||
|
+ifeq (yes,$(enable-userspace-livepatch))
|
||||||
|
++cflags += -fpatchable-function-entry=16,14
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
# The i387 `long double' is a distinct type we support.
|
||||||
|
long-double-fcts = yes
|
||||||
|
|
||||||
diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S b/sysdeps/x86_64/multiarch/strcmp-avx2.S
|
diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S b/sysdeps/x86_64/multiarch/strcmp-avx2.S
|
||||||
index 5bc1d90078..3ea96c0aa3 100644
|
index 4b46a8de17..8266f558d9 100644
|
||||||
--- a/sysdeps/x86_64/multiarch/strcmp-avx2.S
|
--- a/sysdeps/x86_64/multiarch/strcmp-avx2.S
|
||||||
+++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S
|
+++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S
|
||||||
@@ -201,10 +201,7 @@ END (STRCASECMP)
|
@@ -201,10 +201,7 @@ END (STRCASECMP)
|
||||||
@@ -159,10 +306,10 @@ index 5bc1d90078..3ea96c0aa3 100644
|
|||||||
# if defined USE_AS_STRCASECMP_L
|
# if defined USE_AS_STRCASECMP_L
|
||||||
/* We have to fall back on the C implementation for locales with
|
/* We have to fall back on the C implementation for locales with
|
||||||
diff --git a/sysdeps/x86_64/multiarch/strcmp-evex.S b/sysdeps/x86_64/multiarch/strcmp-evex.S
|
diff --git a/sysdeps/x86_64/multiarch/strcmp-evex.S b/sysdeps/x86_64/multiarch/strcmp-evex.S
|
||||||
index 06730ab2a1..d96b1c4824 100644
|
index 6316bb940e..91192f2d2e 100644
|
||||||
--- a/sysdeps/x86_64/multiarch/strcmp-evex.S
|
--- a/sysdeps/x86_64/multiarch/strcmp-evex.S
|
||||||
+++ b/sysdeps/x86_64/multiarch/strcmp-evex.S
|
+++ b/sysdeps/x86_64/multiarch/strcmp-evex.S
|
||||||
@@ -224,10 +224,7 @@ END (STRCASECMP)
|
@@ -226,10 +226,7 @@ END (STRCASECMP)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
.p2align 4
|
.p2align 4
|
||||||
@@ -175,7 +322,7 @@ index 06730ab2a1..d96b1c4824 100644
|
|||||||
# if defined USE_AS_STRCASECMP_L
|
# if defined USE_AS_STRCASECMP_L
|
||||||
/* We have to fall back on the C implementation for locales with
|
/* We have to fall back on the C implementation for locales with
|
||||||
diff --git a/sysdeps/x86_64/multiarch/strcmp-sse4_2.S b/sysdeps/x86_64/multiarch/strcmp-sse4_2.S
|
diff --git a/sysdeps/x86_64/multiarch/strcmp-sse4_2.S b/sysdeps/x86_64/multiarch/strcmp-sse4_2.S
|
||||||
index 4e98da0246..2a2280c65f 100644
|
index 1b746c4b2f..01c8eb44e3 100644
|
||||||
--- a/sysdeps/x86_64/multiarch/strcmp-sse4_2.S
|
--- a/sysdeps/x86_64/multiarch/strcmp-sse4_2.S
|
||||||
+++ b/sysdeps/x86_64/multiarch/strcmp-sse4_2.S
|
+++ b/sysdeps/x86_64/multiarch/strcmp-sse4_2.S
|
||||||
@@ -103,10 +103,7 @@ END (STRCASECMP)
|
@@ -103,10 +103,7 @@ END (STRCASECMP)
|
||||||
@@ -191,7 +338,7 @@ index 4e98da0246..2a2280c65f 100644
|
|||||||
/*
|
/*
|
||||||
* This implementation uses SSE to compare up to 16 bytes at a time.
|
* This implementation uses SSE to compare up to 16 bytes at a time.
|
||||||
diff --git a/sysdeps/x86_64/sysdep.h b/sysdeps/x86_64/sysdep.h
|
diff --git a/sysdeps/x86_64/sysdep.h b/sysdeps/x86_64/sysdep.h
|
||||||
index db6e36b2dd..86a5d1b2be 100644
|
index cb475bec98..2bb84c4c31 100644
|
||||||
--- a/sysdeps/x86_64/sysdep.h
|
--- a/sysdeps/x86_64/sysdep.h
|
||||||
+++ b/sysdeps/x86_64/sysdep.h
|
+++ b/sysdeps/x86_64/sysdep.h
|
||||||
@@ -49,6 +49,46 @@ enum cf_protection_level
|
@@ -49,6 +49,46 @@ enum cf_protection_level
|
||||||
@@ -268,5 +415,5 @@ index db6e36b2dd..86a5d1b2be 100644
|
|||||||
/* This macro is for setting proper CFI with DW_CFA_expression describing
|
/* This macro is for setting proper CFI with DW_CFA_expression describing
|
||||||
the register as saved relative to %rsp instead of relative to the CFA.
|
the register as saved relative to %rsp instead of relative to the CFA.
|
||||||
--
|
--
|
||||||
2.44.0
|
2.49.0
|
||||||
|
|
||||||
|
@@ -1,645 +0,0 @@
|
|||||||
From 9831f98c266a8d56d1bf729b709c08e40375540c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Florian Weimer <fweimer@redhat.com>
|
|
||||||
Date: Fri, 19 Apr 2024 14:38:17 +0200
|
|
||||||
Subject: [PATCH] login: Check default sizes of structs utmp, utmpx, lastlog
|
|
||||||
|
|
||||||
The default <utmp-size.h> is for ports with a 64-bit time_t.
|
|
||||||
Ports with a 32-bit time_t or with __WORDSIZE_TIME64_COMPAT32=1
|
|
||||||
need to override it.
|
|
||||||
|
|
||||||
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
|
||||||
(cherry picked from commit 4d4da5aab936504b2d3eca3146e109630d9093c4)
|
|
||||||
---
|
|
||||||
login/Makefile | 2 +-
|
|
||||||
login/tst-utmp-size.c | 33 +++++++++++++++++++++++++++++++++
|
|
||||||
sysdeps/arc/utmp-size.h | 3 +++
|
|
||||||
sysdeps/arm/utmp-size.h | 2 ++
|
|
||||||
sysdeps/csky/utmp-size.h | 2 ++
|
|
||||||
sysdeps/generic/utmp-size.h | 23 +++++++++++++++++++++++
|
|
||||||
sysdeps/hppa/utmp-size.h | 2 ++
|
|
||||||
sysdeps/m68k/utmp-size.h | 3 +++
|
|
||||||
sysdeps/microblaze/utmp-size.h | 2 ++
|
|
||||||
sysdeps/mips/utmp-size.h | 2 ++
|
|
||||||
sysdeps/nios2/utmp-size.h | 2 ++
|
|
||||||
sysdeps/or1k/utmp-size.h | 3 +++
|
|
||||||
sysdeps/powerpc/utmp-size.h | 2 ++
|
|
||||||
sysdeps/riscv/utmp-size.h | 2 ++
|
|
||||||
sysdeps/sh/utmp-size.h | 2 ++
|
|
||||||
sysdeps/sparc/utmp-size.h | 2 ++
|
|
||||||
sysdeps/x86/utmp-size.h | 2 ++
|
|
||||||
17 files changed, 88 insertions(+), 1 deletion(-)
|
|
||||||
create mode 100644 login/tst-utmp-size.c
|
|
||||||
create mode 100644 sysdeps/arc/utmp-size.h
|
|
||||||
create mode 100644 sysdeps/arm/utmp-size.h
|
|
||||||
create mode 100644 sysdeps/csky/utmp-size.h
|
|
||||||
create mode 100644 sysdeps/generic/utmp-size.h
|
|
||||||
create mode 100644 sysdeps/hppa/utmp-size.h
|
|
||||||
create mode 100644 sysdeps/m68k/utmp-size.h
|
|
||||||
create mode 100644 sysdeps/microblaze/utmp-size.h
|
|
||||||
create mode 100644 sysdeps/mips/utmp-size.h
|
|
||||||
create mode 100644 sysdeps/nios2/utmp-size.h
|
|
||||||
create mode 100644 sysdeps/or1k/utmp-size.h
|
|
||||||
create mode 100644 sysdeps/powerpc/utmp-size.h
|
|
||||||
create mode 100644 sysdeps/riscv/utmp-size.h
|
|
||||||
create mode 100644 sysdeps/sh/utmp-size.h
|
|
||||||
create mode 100644 sysdeps/sparc/utmp-size.h
|
|
||||||
create mode 100644 sysdeps/x86/utmp-size.h
|
|
||||||
|
|
||||||
diff --git a/login/Makefile b/login/Makefile
|
|
||||||
index 1e22008a61..b26ac42bfc 100644
|
|
||||||
--- a/login/Makefile
|
|
||||||
+++ b/login/Makefile
|
|
||||||
@@ -44,7 +44,7 @@ subdir-dirs = programs
|
|
||||||
vpath %.c programs
|
|
||||||
|
|
||||||
tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin tst-updwtmpx \
|
|
||||||
- tst-pututxline-lockfail tst-pututxline-cache
|
|
||||||
+ tst-pututxline-lockfail tst-pututxline-cache tst-utmp-size
|
|
||||||
|
|
||||||
# Empty compatibility library for old binaries.
|
|
||||||
extra-libs := libutil
|
|
||||||
diff --git a/login/tst-utmp-size.c b/login/tst-utmp-size.c
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..1b7f7ff042
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/login/tst-utmp-size.c
|
|
||||||
@@ -0,0 +1,33 @@
|
|
||||||
+/* Check expected sizes of struct utmp, struct utmpx, struct lastlog.
|
|
||||||
+ Copyright (C) 2024 Free Software Foundation, Inc.
|
|
||||||
+ This file is part of the GNU C Library.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
+ modify it under the terms of the GNU Lesser General Public
|
|
||||||
+ License as published by the Free Software Foundation; either
|
|
||||||
+ version 2.1 of the License, or (at your option) any later version.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
+ Lesser General Public License for more details.
|
|
||||||
+
|
|
||||||
+ You should have received a copy of the GNU Lesser General Public
|
|
||||||
+ License along with the GNU C Library; if not, see
|
|
||||||
+ <https://www.gnu.org/licenses/>. */
|
|
||||||
+
|
|
||||||
+#include <utmp.h>
|
|
||||||
+#include <utmpx.h>
|
|
||||||
+#include <utmp-size.h>
|
|
||||||
+
|
|
||||||
+static int
|
|
||||||
+do_test (void)
|
|
||||||
+{
|
|
||||||
+ _Static_assert (sizeof (struct utmp) == UTMP_SIZE, "struct utmp size");
|
|
||||||
+ _Static_assert (sizeof (struct utmpx) == UTMP_SIZE, "struct utmpx size");
|
|
||||||
+ _Static_assert (sizeof (struct lastlog) == LASTLOG_SIZE,
|
|
||||||
+ "struct lastlog size");
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+#include <support/test-driver.c>
|
|
||||||
diff --git a/sysdeps/arc/utmp-size.h b/sysdeps/arc/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..a247fcd3da
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/arc/utmp-size.h
|
|
||||||
@@ -0,0 +1,3 @@
|
|
||||||
+/* arc has less padding than other architectures with 64-bit time_t. */
|
|
||||||
+#define UTMP_SIZE 392
|
|
||||||
+#define LASTLOG_SIZE 296
|
|
||||||
diff --git a/sysdeps/arm/utmp-size.h b/sysdeps/arm/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..8f21ebe1b6
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/arm/utmp-size.h
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+#define UTMP_SIZE 384
|
|
||||||
+#define LASTLOG_SIZE 292
|
|
||||||
diff --git a/sysdeps/csky/utmp-size.h b/sysdeps/csky/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..8f21ebe1b6
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/csky/utmp-size.h
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+#define UTMP_SIZE 384
|
|
||||||
+#define LASTLOG_SIZE 292
|
|
||||||
diff --git a/sysdeps/generic/utmp-size.h b/sysdeps/generic/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..89dbe878b0
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/generic/utmp-size.h
|
|
||||||
@@ -0,0 +1,23 @@
|
|
||||||
+/* Expected sizes of utmp-related structures stored in files. 64-bit version.
|
|
||||||
+ Copyright (C) 2024 Free Software Foundation, Inc.
|
|
||||||
+ This file is part of the GNU C Library.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
+ modify it under the terms of the GNU Lesser General Public
|
|
||||||
+ License as published by the Free Software Foundation; either
|
|
||||||
+ version 2.1 of the License, or (at your option) any later version.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
+ Lesser General Public License for more details.
|
|
||||||
+
|
|
||||||
+ You should have received a copy of the GNU Lesser General Public
|
|
||||||
+ License along with the GNU C Library; if not, see
|
|
||||||
+ <https://www.gnu.org/licenses/>. */
|
|
||||||
+
|
|
||||||
+/* Expected size, in bytes, of struct utmp and struct utmpx. */
|
|
||||||
+#define UTMP_SIZE 400
|
|
||||||
+
|
|
||||||
+/* Expected size, in bytes, of struct lastlog. */
|
|
||||||
+#define LASTLOG_SIZE 296
|
|
||||||
diff --git a/sysdeps/hppa/utmp-size.h b/sysdeps/hppa/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..8f21ebe1b6
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/hppa/utmp-size.h
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+#define UTMP_SIZE 384
|
|
||||||
+#define LASTLOG_SIZE 292
|
|
||||||
diff --git a/sysdeps/m68k/utmp-size.h b/sysdeps/m68k/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..5946685819
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/m68k/utmp-size.h
|
|
||||||
@@ -0,0 +1,3 @@
|
|
||||||
+/* m68k has 2-byte alignment. */
|
|
||||||
+#define UTMP_SIZE 382
|
|
||||||
+#define LASTLOG_SIZE 292
|
|
||||||
diff --git a/sysdeps/microblaze/utmp-size.h b/sysdeps/microblaze/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..8f21ebe1b6
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/microblaze/utmp-size.h
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+#define UTMP_SIZE 384
|
|
||||||
+#define LASTLOG_SIZE 292
|
|
||||||
diff --git a/sysdeps/mips/utmp-size.h b/sysdeps/mips/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..8f21ebe1b6
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/mips/utmp-size.h
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+#define UTMP_SIZE 384
|
|
||||||
+#define LASTLOG_SIZE 292
|
|
||||||
diff --git a/sysdeps/nios2/utmp-size.h b/sysdeps/nios2/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..8f21ebe1b6
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/nios2/utmp-size.h
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+#define UTMP_SIZE 384
|
|
||||||
+#define LASTLOG_SIZE 292
|
|
||||||
diff --git a/sysdeps/or1k/utmp-size.h b/sysdeps/or1k/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..6b3653aa4d
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/or1k/utmp-size.h
|
|
||||||
@@ -0,0 +1,3 @@
|
|
||||||
+/* or1k has less padding than other architectures with 64-bit time_t. */
|
|
||||||
+#define UTMP_SIZE 392
|
|
||||||
+#define LASTLOG_SIZE 296
|
|
||||||
diff --git a/sysdeps/powerpc/utmp-size.h b/sysdeps/powerpc/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..8f21ebe1b6
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/powerpc/utmp-size.h
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+#define UTMP_SIZE 384
|
|
||||||
+#define LASTLOG_SIZE 292
|
|
||||||
diff --git a/sysdeps/riscv/utmp-size.h b/sysdeps/riscv/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..8f21ebe1b6
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/riscv/utmp-size.h
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+#define UTMP_SIZE 384
|
|
||||||
+#define LASTLOG_SIZE 292
|
|
||||||
diff --git a/sysdeps/sh/utmp-size.h b/sysdeps/sh/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..8f21ebe1b6
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/sh/utmp-size.h
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+#define UTMP_SIZE 384
|
|
||||||
+#define LASTLOG_SIZE 292
|
|
||||||
diff --git a/sysdeps/sparc/utmp-size.h b/sysdeps/sparc/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..8f21ebe1b6
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/sparc/utmp-size.h
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+#define UTMP_SIZE 384
|
|
||||||
+#define LASTLOG_SIZE 292
|
|
||||||
diff --git a/sysdeps/x86/utmp-size.h b/sysdeps/x86/utmp-size.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..8f21ebe1b6
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/x86/utmp-size.h
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+#define UTMP_SIZE 384
|
|
||||||
+#define LASTLOG_SIZE 292
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
||||||
From 836d43b98973e0845b739ff5d3aad3af09dc7d0f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Florian Weimer <fweimer@redhat.com>
|
|
||||||
Date: Fri, 19 Apr 2024 14:38:17 +0200
|
|
||||||
Subject: [PATCH] login: structs utmp, utmpx, lastlog _TIME_BITS independence
|
|
||||||
(bug 30701)
|
|
||||||
|
|
||||||
These structs describe file formats under /var/log, and should not
|
|
||||||
depend on the definition of _TIME_BITS. This is achieved by
|
|
||||||
defining __WORDSIZE_TIME64_COMPAT32 to 1 on 32-bit ports that
|
|
||||||
support 32-bit time_t values (where __time_t is 32 bits).
|
|
||||||
|
|
||||||
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
|
||||||
(cherry picked from commit 9abdae94c7454c45e02e97e4ed1eb1b1915d13d8)
|
|
||||||
---
|
|
||||||
bits/wordsize.h | 6 ++++--
|
|
||||||
login/Makefile | 4 +++-
|
|
||||||
login/tst-utmp-size-64.c | 2 ++
|
|
||||||
sysdeps/arm/bits/wordsize.h | 21 +++++++++++++++++++
|
|
||||||
sysdeps/csky/bits/wordsize.h | 21 +++++++++++++++++++
|
|
||||||
sysdeps/m68k/bits/wordsize.h | 21 +++++++++++++++++++
|
|
||||||
sysdeps/microblaze/bits/wordsize.h | 21 +++++++++++++++++++
|
|
||||||
sysdeps/mips/bits/wordsize.h | 6 +-----
|
|
||||||
sysdeps/nios2/bits/wordsize.h | 21 +++++++++++++++++++
|
|
||||||
sysdeps/powerpc/powerpc32/bits/wordsize.h | 3 +--
|
|
||||||
sysdeps/powerpc/powerpc64/bits/wordsize.h | 3 +--
|
|
||||||
sysdeps/sh/bits/wordsize.h | 21 +++++++++++++++++++
|
|
||||||
sysdeps/sparc/sparc32/bits/wordsize.h | 2 +-
|
|
||||||
sysdeps/sparc/sparc64/bits/wordsize.h | 3 +--
|
|
||||||
sysdeps/unix/sysv/linux/hppa/bits/wordsize.h | 21 +++++++++++++++++++
|
|
||||||
.../unix/sysv/linux/powerpc/bits/wordsize.h | 3 +--
|
|
||||||
sysdeps/unix/sysv/linux/sparc/bits/wordsize.h | 3 +--
|
|
||||||
sysdeps/x86/bits/wordsize.h | 5 ++---
|
|
||||||
18 files changed, 165 insertions(+), 22 deletions(-)
|
|
||||||
create mode 100644 login/tst-utmp-size-64.c
|
|
||||||
create mode 100644 sysdeps/arm/bits/wordsize.h
|
|
||||||
create mode 100644 sysdeps/csky/bits/wordsize.h
|
|
||||||
create mode 100644 sysdeps/m68k/bits/wordsize.h
|
|
||||||
create mode 100644 sysdeps/microblaze/bits/wordsize.h
|
|
||||||
create mode 100644 sysdeps/nios2/bits/wordsize.h
|
|
||||||
create mode 100644 sysdeps/sh/bits/wordsize.h
|
|
||||||
create mode 100644 sysdeps/unix/sysv/linux/hppa/bits/wordsize.h
|
|
||||||
|
|
||||||
diff --git a/bits/wordsize.h b/bits/wordsize.h
|
|
||||||
index 14edae3a11..53013a9275 100644
|
|
||||||
--- a/bits/wordsize.h
|
|
||||||
+++ b/bits/wordsize.h
|
|
||||||
@@ -21,7 +21,9 @@
|
|
||||||
#define __WORDSIZE32_PTRDIFF_LONG
|
|
||||||
|
|
||||||
/* Set to 1 in order to force time types to be 32 bits instead of 64 bits in
|
|
||||||
- struct lastlog and struct utmp{,x} on 64-bit ports. This may be done in
|
|
||||||
+ struct lastlog and struct utmp{,x}. This may be done in
|
|
||||||
order to make 64-bit ports compatible with 32-bit ports. Set to 0 for
|
|
||||||
- 64-bit ports where the time types are 64-bits or for any 32-bit ports. */
|
|
||||||
+ 64-bit ports where the time types are 64-bits and new 32-bit ports
|
|
||||||
+ where time_t is 64 bits, and there is no companion architecture with
|
|
||||||
+ 32-bit time_t. */
|
|
||||||
#define __WORDSIZE_TIME64_COMPAT32
|
|
||||||
diff --git a/login/Makefile b/login/Makefile
|
|
||||||
index b26ac42bfc..f91190e3dc 100644
|
|
||||||
--- a/login/Makefile
|
|
||||||
+++ b/login/Makefile
|
|
||||||
@@ -44,7 +44,9 @@ subdir-dirs = programs
|
|
||||||
vpath %.c programs
|
|
||||||
|
|
||||||
tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin tst-updwtmpx \
|
|
||||||
- tst-pututxline-lockfail tst-pututxline-cache tst-utmp-size
|
|
||||||
+ tst-pututxline-lockfail tst-pututxline-cache tst-utmp-size tst-utmp-size-64
|
|
||||||
+
|
|
||||||
+CFLAGS-tst-utmp-size-64.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64
|
|
||||||
|
|
||||||
# Empty compatibility library for old binaries.
|
|
||||||
extra-libs := libutil
|
|
||||||
diff --git a/login/tst-utmp-size-64.c b/login/tst-utmp-size-64.c
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..7a581a4c12
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/login/tst-utmp-size-64.c
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+/* The on-disk layout must not change in time64 mode. */
|
|
||||||
+#include "tst-utmp-size.c"
|
|
||||||
diff --git a/sysdeps/arm/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..6ecbfe7c86
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/arm/bits/wordsize.h
|
|
||||||
@@ -0,0 +1,21 @@
|
|
||||||
+/* Copyright (C) 1999-2024 Free Software Foundation, Inc.
|
|
||||||
+ This file is part of the GNU C Library.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
+ modify it under the terms of the GNU Lesser General Public
|
|
||||||
+ License as published by the Free Software Foundation; either
|
|
||||||
+ version 2.1 of the License, or (at your option) any later version.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
+ Lesser General Public License for more details.
|
|
||||||
+
|
|
||||||
+ You should have received a copy of the GNU Lesser General Public
|
|
||||||
+ License along with the GNU C Library; if not, see
|
|
||||||
+ <https://www.gnu.org/licenses/>. */
|
|
||||||
+
|
|
||||||
+#define __WORDSIZE 32
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
+#define __WORDSIZE32_SIZE_ULONG 0
|
|
||||||
+#define __WORDSIZE32_PTRDIFF_LONG 0
|
|
||||||
diff --git a/sysdeps/csky/bits/wordsize.h b/sysdeps/csky/bits/wordsize.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..6ecbfe7c86
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/csky/bits/wordsize.h
|
|
||||||
@@ -0,0 +1,21 @@
|
|
||||||
+/* Copyright (C) 1999-2024 Free Software Foundation, Inc.
|
|
||||||
+ This file is part of the GNU C Library.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
+ modify it under the terms of the GNU Lesser General Public
|
|
||||||
+ License as published by the Free Software Foundation; either
|
|
||||||
+ version 2.1 of the License, or (at your option) any later version.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
+ Lesser General Public License for more details.
|
|
||||||
+
|
|
||||||
+ You should have received a copy of the GNU Lesser General Public
|
|
||||||
+ License along with the GNU C Library; if not, see
|
|
||||||
+ <https://www.gnu.org/licenses/>. */
|
|
||||||
+
|
|
||||||
+#define __WORDSIZE 32
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
+#define __WORDSIZE32_SIZE_ULONG 0
|
|
||||||
+#define __WORDSIZE32_PTRDIFF_LONG 0
|
|
||||||
diff --git a/sysdeps/m68k/bits/wordsize.h b/sysdeps/m68k/bits/wordsize.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..6ecbfe7c86
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/m68k/bits/wordsize.h
|
|
||||||
@@ -0,0 +1,21 @@
|
|
||||||
+/* Copyright (C) 1999-2024 Free Software Foundation, Inc.
|
|
||||||
+ This file is part of the GNU C Library.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
+ modify it under the terms of the GNU Lesser General Public
|
|
||||||
+ License as published by the Free Software Foundation; either
|
|
||||||
+ version 2.1 of the License, or (at your option) any later version.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
+ Lesser General Public License for more details.
|
|
||||||
+
|
|
||||||
+ You should have received a copy of the GNU Lesser General Public
|
|
||||||
+ License along with the GNU C Library; if not, see
|
|
||||||
+ <https://www.gnu.org/licenses/>. */
|
|
||||||
+
|
|
||||||
+#define __WORDSIZE 32
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
+#define __WORDSIZE32_SIZE_ULONG 0
|
|
||||||
+#define __WORDSIZE32_PTRDIFF_LONG 0
|
|
||||||
diff --git a/sysdeps/microblaze/bits/wordsize.h b/sysdeps/microblaze/bits/wordsize.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..6ecbfe7c86
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/microblaze/bits/wordsize.h
|
|
||||||
@@ -0,0 +1,21 @@
|
|
||||||
+/* Copyright (C) 1999-2024 Free Software Foundation, Inc.
|
|
||||||
+ This file is part of the GNU C Library.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
+ modify it under the terms of the GNU Lesser General Public
|
|
||||||
+ License as published by the Free Software Foundation; either
|
|
||||||
+ version 2.1 of the License, or (at your option) any later version.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
+ Lesser General Public License for more details.
|
|
||||||
+
|
|
||||||
+ You should have received a copy of the GNU Lesser General Public
|
|
||||||
+ License along with the GNU C Library; if not, see
|
|
||||||
+ <https://www.gnu.org/licenses/>. */
|
|
||||||
+
|
|
||||||
+#define __WORDSIZE 32
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
+#define __WORDSIZE32_SIZE_ULONG 0
|
|
||||||
+#define __WORDSIZE32_PTRDIFF_LONG 0
|
|
||||||
diff --git a/sysdeps/mips/bits/wordsize.h b/sysdeps/mips/bits/wordsize.h
|
|
||||||
index 57f0f2a22f..30dd3fd85d 100644
|
|
||||||
--- a/sysdeps/mips/bits/wordsize.h
|
|
||||||
+++ b/sysdeps/mips/bits/wordsize.h
|
|
||||||
@@ -19,11 +19,7 @@
|
|
||||||
|
|
||||||
#define __WORDSIZE _MIPS_SZPTR
|
|
||||||
|
|
||||||
-#if _MIPS_SIM == _ABI64
|
|
||||||
-# define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
-#else
|
|
||||||
-# define __WORDSIZE_TIME64_COMPAT32 0
|
|
||||||
-#endif
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
|
|
||||||
#if __WORDSIZE == 32
|
|
||||||
#define __WORDSIZE32_SIZE_ULONG 0
|
|
||||||
diff --git a/sysdeps/nios2/bits/wordsize.h b/sysdeps/nios2/bits/wordsize.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..6ecbfe7c86
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/nios2/bits/wordsize.h
|
|
||||||
@@ -0,0 +1,21 @@
|
|
||||||
+/* Copyright (C) 1999-2024 Free Software Foundation, Inc.
|
|
||||||
+ This file is part of the GNU C Library.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
+ modify it under the terms of the GNU Lesser General Public
|
|
||||||
+ License as published by the Free Software Foundation; either
|
|
||||||
+ version 2.1 of the License, or (at your option) any later version.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
+ Lesser General Public License for more details.
|
|
||||||
+
|
|
||||||
+ You should have received a copy of the GNU Lesser General Public
|
|
||||||
+ License along with the GNU C Library; if not, see
|
|
||||||
+ <https://www.gnu.org/licenses/>. */
|
|
||||||
+
|
|
||||||
+#define __WORDSIZE 32
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
+#define __WORDSIZE32_SIZE_ULONG 0
|
|
||||||
+#define __WORDSIZE32_PTRDIFF_LONG 0
|
|
||||||
diff --git a/sysdeps/powerpc/powerpc32/bits/wordsize.h b/sysdeps/powerpc/powerpc32/bits/wordsize.h
|
|
||||||
index 04ca9debf0..6993fb6b29 100644
|
|
||||||
--- a/sysdeps/powerpc/powerpc32/bits/wordsize.h
|
|
||||||
+++ b/sysdeps/powerpc/powerpc32/bits/wordsize.h
|
|
||||||
@@ -2,10 +2,9 @@
|
|
||||||
|
|
||||||
#if defined __powerpc64__
|
|
||||||
# define __WORDSIZE 64
|
|
||||||
-# define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
#else
|
|
||||||
# define __WORDSIZE 32
|
|
||||||
-# define __WORDSIZE_TIME64_COMPAT32 0
|
|
||||||
# define __WORDSIZE32_SIZE_ULONG 0
|
|
||||||
# define __WORDSIZE32_PTRDIFF_LONG 0
|
|
||||||
#endif
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
diff --git a/sysdeps/powerpc/powerpc64/bits/wordsize.h b/sysdeps/powerpc/powerpc64/bits/wordsize.h
|
|
||||||
index 04ca9debf0..6993fb6b29 100644
|
|
||||||
--- a/sysdeps/powerpc/powerpc64/bits/wordsize.h
|
|
||||||
+++ b/sysdeps/powerpc/powerpc64/bits/wordsize.h
|
|
||||||
@@ -2,10 +2,9 @@
|
|
||||||
|
|
||||||
#if defined __powerpc64__
|
|
||||||
# define __WORDSIZE 64
|
|
||||||
-# define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
#else
|
|
||||||
# define __WORDSIZE 32
|
|
||||||
-# define __WORDSIZE_TIME64_COMPAT32 0
|
|
||||||
# define __WORDSIZE32_SIZE_ULONG 0
|
|
||||||
# define __WORDSIZE32_PTRDIFF_LONG 0
|
|
||||||
#endif
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
diff --git a/sysdeps/sh/bits/wordsize.h b/sysdeps/sh/bits/wordsize.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..6ecbfe7c86
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/sh/bits/wordsize.h
|
|
||||||
@@ -0,0 +1,21 @@
|
|
||||||
+/* Copyright (C) 1999-2024 Free Software Foundation, Inc.
|
|
||||||
+ This file is part of the GNU C Library.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
+ modify it under the terms of the GNU Lesser General Public
|
|
||||||
+ License as published by the Free Software Foundation; either
|
|
||||||
+ version 2.1 of the License, or (at your option) any later version.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
+ Lesser General Public License for more details.
|
|
||||||
+
|
|
||||||
+ You should have received a copy of the GNU Lesser General Public
|
|
||||||
+ License along with the GNU C Library; if not, see
|
|
||||||
+ <https://www.gnu.org/licenses/>. */
|
|
||||||
+
|
|
||||||
+#define __WORDSIZE 32
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
+#define __WORDSIZE32_SIZE_ULONG 0
|
|
||||||
+#define __WORDSIZE32_PTRDIFF_LONG 0
|
|
||||||
diff --git a/sysdeps/sparc/sparc32/bits/wordsize.h b/sysdeps/sparc/sparc32/bits/wordsize.h
|
|
||||||
index 4bbd2e63b4..a2e79e0fa9 100644
|
|
||||||
--- a/sysdeps/sparc/sparc32/bits/wordsize.h
|
|
||||||
+++ b/sysdeps/sparc/sparc32/bits/wordsize.h
|
|
||||||
@@ -1,6 +1,6 @@
|
|
||||||
/* Determine the wordsize from the preprocessor defines. */
|
|
||||||
|
|
||||||
#define __WORDSIZE 32
|
|
||||||
-#define __WORDSIZE_TIME64_COMPAT32 0
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
#define __WORDSIZE32_SIZE_ULONG 0
|
|
||||||
#define __WORDSIZE32_PTRDIFF_LONG 0
|
|
||||||
diff --git a/sysdeps/sparc/sparc64/bits/wordsize.h b/sysdeps/sparc/sparc64/bits/wordsize.h
|
|
||||||
index 2f66f10d72..ea103e5970 100644
|
|
||||||
--- a/sysdeps/sparc/sparc64/bits/wordsize.h
|
|
||||||
+++ b/sysdeps/sparc/sparc64/bits/wordsize.h
|
|
||||||
@@ -2,10 +2,9 @@
|
|
||||||
|
|
||||||
#if defined __arch64__ || defined __sparcv9
|
|
||||||
# define __WORDSIZE 64
|
|
||||||
-# define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
#else
|
|
||||||
# define __WORDSIZE 32
|
|
||||||
-# define __WORDSIZE_TIME64_COMPAT32 0
|
|
||||||
# define __WORDSIZE32_SIZE_ULONG 0
|
|
||||||
# define __WORDSIZE32_PTRDIFF_LONG 0
|
|
||||||
#endif
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/wordsize.h b/sysdeps/unix/sysv/linux/hppa/bits/wordsize.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..6ecbfe7c86
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sysdeps/unix/sysv/linux/hppa/bits/wordsize.h
|
|
||||||
@@ -0,0 +1,21 @@
|
|
||||||
+/* Copyright (C) 1999-2024 Free Software Foundation, Inc.
|
|
||||||
+ This file is part of the GNU C Library.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
+ modify it under the terms of the GNU Lesser General Public
|
|
||||||
+ License as published by the Free Software Foundation; either
|
|
||||||
+ version 2.1 of the License, or (at your option) any later version.
|
|
||||||
+
|
|
||||||
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
+ Lesser General Public License for more details.
|
|
||||||
+
|
|
||||||
+ You should have received a copy of the GNU Lesser General Public
|
|
||||||
+ License along with the GNU C Library; if not, see
|
|
||||||
+ <https://www.gnu.org/licenses/>. */
|
|
||||||
+
|
|
||||||
+#define __WORDSIZE 32
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
+#define __WORDSIZE32_SIZE_ULONG 0
|
|
||||||
+#define __WORDSIZE32_PTRDIFF_LONG 0
|
|
||||||
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
|
|
||||||
index 04ca9debf0..6993fb6b29 100644
|
|
||||||
--- a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
|
|
||||||
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
|
|
||||||
@@ -2,10 +2,9 @@
|
|
||||||
|
|
||||||
#if defined __powerpc64__
|
|
||||||
# define __WORDSIZE 64
|
|
||||||
-# define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
#else
|
|
||||||
# define __WORDSIZE 32
|
|
||||||
-# define __WORDSIZE_TIME64_COMPAT32 0
|
|
||||||
# define __WORDSIZE32_SIZE_ULONG 0
|
|
||||||
# define __WORDSIZE32_PTRDIFF_LONG 0
|
|
||||||
#endif
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h b/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
|
|
||||||
index 7562875ee2..ea103e5970 100644
|
|
||||||
--- a/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
|
|
||||||
+++ b/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
|
|
||||||
@@ -2,10 +2,9 @@
|
|
||||||
|
|
||||||
#if defined __arch64__ || defined __sparcv9
|
|
||||||
# define __WORDSIZE 64
|
|
||||||
-# define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
#else
|
|
||||||
# define __WORDSIZE 32
|
|
||||||
# define __WORDSIZE32_SIZE_ULONG 0
|
|
||||||
# define __WORDSIZE32_PTRDIFF_LONG 0
|
|
||||||
-# define __WORDSIZE_TIME64_COMPAT32 0
|
|
||||||
#endif
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
diff --git a/sysdeps/x86/bits/wordsize.h b/sysdeps/x86/bits/wordsize.h
|
|
||||||
index 70f652bca1..3f40aa76f9 100644
|
|
||||||
--- a/sysdeps/x86/bits/wordsize.h
|
|
||||||
+++ b/sysdeps/x86/bits/wordsize.h
|
|
||||||
@@ -8,10 +8,9 @@
|
|
||||||
#define __WORDSIZE32_PTRDIFF_LONG 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
+
|
|
||||||
#ifdef __x86_64__
|
|
||||||
-# define __WORDSIZE_TIME64_COMPAT32 1
|
|
||||||
/* Both x86-64 and x32 use the 64-bit system call interface. */
|
|
||||||
# define __SYSCALL_WORDSIZE 64
|
|
||||||
-#else
|
|
||||||
-# define __WORDSIZE_TIME64_COMPAT32 0
|
|
||||||
#endif
|
|
||||||
--
|
|
||||||
2.45.0
|
|
||||||
|
|
Reference in New Issue
Block a user