From e8d9a43fff696575dc247b4fa033caa15df371fd Mon Sep 17 00:00:00 2001
From: Peridot Bot <rockyautomation@rockylinux.org>
Date: Tue, 2 Apr 2024 17:27:57 +0000
Subject: [PATCH] import glibc-2.34-100.el9

---
 .glibc.checksum                  |   2 +-
 .glibc.metadata                  |   2 +-
 SOURCES/glibc-RHEL-1191.patch    |  69 ++++
 SOURCES/glibc-RHEL-14383-1.patch |  72 ++++
 SOURCES/glibc-RHEL-14383-2.patch |  61 ++++
 SOURCES/glibc-RHEL-15343-1.patch |  26 ++
 SOURCES/glibc-RHEL-15343-2.patch | 233 ++++++++++++
 SOURCES/glibc-RHEL-15343-3.patch | 232 ++++++++++++
 SOURCES/glibc-RHEL-15343-4.patch |  33 ++
 SOURCES/glibc-RHEL-16016-1.patch |  26 ++
 SOURCES/glibc-RHEL-16016-2.patch |  24 ++
 SOURCES/glibc-RHEL-16016-3.patch |  26 ++
 SOURCES/glibc-RHEL-16016-4.patch |  26 ++
 SOURCES/glibc-RHEL-16016-5.patch |  83 +++++
 SOURCES/glibc-RHEL-16016-6.patch | 338 ++++++++++++++++++
 SOURCES/glibc-RHEL-16016-7.patch | 350 ++++++++++++++++++
 SOURCES/glibc-RHEL-16275.patch   |  16 +
 SOURCES/glibc-RHEL-16643-1.patch | 211 +++++++++++
 SOURCES/glibc-RHEL-16643-2.patch | 584 +++++++++++++++++++++++++++++++
 SOURCES/glibc-RHEL-16643-3.patch |  90 +++++
 SOURCES/glibc-RHEL-16643-4.patch |  32 ++
 SOURCES/glibc-RHEL-16643-5.patch |  25 ++
 SOURCES/glibc-RHEL-16643-6.patch |  23 ++
 SOURCES/glibc-RHEL-17319-1.patch |  35 ++
 SOURCES/glibc-RHEL-17319-2.patch | 121 +++++++
 SOURCES/glibc-RHEL-17319-3.patch | 224 ++++++++++++
 SOURCES/glibc-RHEL-17319-4.patch |  41 +++
 SOURCES/glibc-RHEL-17465-1.patch |  47 +++
 SOURCES/glibc-RHEL-17465-2.patch | 198 +++++++++++
 SOURCES/glibc-RHEL-19444.patch   |  29 ++
 SOURCES/glibc-RHEL-19862.patch   |  27 ++
 SOURCES/glibc-RHEL-2123.patch    | 317 +++++++++++++++++
 SOURCES/glibc-RHEL-21556.patch   |  33 ++
 SOURCES/glibc-RHEL-2338-1.patch  |  47 +++
 SOURCES/glibc-RHEL-2338-2.patch  |  36 ++
 SOURCES/glibc-RHEL-2338-3.patch  |  30 ++
 SOURCES/glibc-RHEL-2338-4.patch  | 157 +++++++++
 SOURCES/glibc-RHEL-2491.patch    | 112 ++++++
 SOURCES/glibc-RHEL-3397.patch    |  83 +++++
 SOURCES/glibc-rhel-17157.patch   |  95 +++++
 SPECS/glibc.spec                 |  93 ++++-
 41 files changed, 4306 insertions(+), 3 deletions(-)
 create mode 100644 SOURCES/glibc-RHEL-1191.patch
 create mode 100644 SOURCES/glibc-RHEL-14383-1.patch
 create mode 100644 SOURCES/glibc-RHEL-14383-2.patch
 create mode 100644 SOURCES/glibc-RHEL-15343-1.patch
 create mode 100644 SOURCES/glibc-RHEL-15343-2.patch
 create mode 100644 SOURCES/glibc-RHEL-15343-3.patch
 create mode 100644 SOURCES/glibc-RHEL-15343-4.patch
 create mode 100644 SOURCES/glibc-RHEL-16016-1.patch
 create mode 100644 SOURCES/glibc-RHEL-16016-2.patch
 create mode 100644 SOURCES/glibc-RHEL-16016-3.patch
 create mode 100644 SOURCES/glibc-RHEL-16016-4.patch
 create mode 100644 SOURCES/glibc-RHEL-16016-5.patch
 create mode 100644 SOURCES/glibc-RHEL-16016-6.patch
 create mode 100644 SOURCES/glibc-RHEL-16016-7.patch
 create mode 100644 SOURCES/glibc-RHEL-16275.patch
 create mode 100644 SOURCES/glibc-RHEL-16643-1.patch
 create mode 100644 SOURCES/glibc-RHEL-16643-2.patch
 create mode 100644 SOURCES/glibc-RHEL-16643-3.patch
 create mode 100644 SOURCES/glibc-RHEL-16643-4.patch
 create mode 100644 SOURCES/glibc-RHEL-16643-5.patch
 create mode 100644 SOURCES/glibc-RHEL-16643-6.patch
 create mode 100644 SOURCES/glibc-RHEL-17319-1.patch
 create mode 100644 SOURCES/glibc-RHEL-17319-2.patch
 create mode 100644 SOURCES/glibc-RHEL-17319-3.patch
 create mode 100644 SOURCES/glibc-RHEL-17319-4.patch
 create mode 100644 SOURCES/glibc-RHEL-17465-1.patch
 create mode 100644 SOURCES/glibc-RHEL-17465-2.patch
 create mode 100644 SOURCES/glibc-RHEL-19444.patch
 create mode 100644 SOURCES/glibc-RHEL-19862.patch
 create mode 100644 SOURCES/glibc-RHEL-2123.patch
 create mode 100644 SOURCES/glibc-RHEL-21556.patch
 create mode 100644 SOURCES/glibc-RHEL-2338-1.patch
 create mode 100644 SOURCES/glibc-RHEL-2338-2.patch
 create mode 100644 SOURCES/glibc-RHEL-2338-3.patch
 create mode 100644 SOURCES/glibc-RHEL-2338-4.patch
 create mode 100644 SOURCES/glibc-RHEL-2491.patch
 create mode 100644 SOURCES/glibc-RHEL-3397.patch
 create mode 100644 SOURCES/glibc-rhel-17157.patch

diff --git a/.glibc.checksum b/.glibc.checksum
index 952c5ea..d358c37 100644
--- a/.glibc.checksum
+++ b/.glibc.checksum
@@ -1 +1 @@
-066ad415707a1aba1770dc60b00441c1521842d710154be4ddf5b8e08abd2fb7
+54baf21f992817d2a795951a8077b40f023c0234ba9e7be5a55de9e0cb83982d
diff --git a/.glibc.metadata b/.glibc.metadata
index f1959eb..78c6d1a 100644
--- a/.glibc.metadata
+++ b/.glibc.metadata
@@ -1,3 +1,3 @@
-44d26a1fe20b8853a48f470ead01e4279e869ac149b195dda4e44a195d981ab2 SOURCES/glibc-2.34.tar.xz
 a9d3c0660e6a48bb22dc77afbc7bb47ce79ca0d8c2ee8ebee4228d8d4952214e SOURCES/glibc-c-utf8-locale-2.patch
 db7430035b16972d0c556d4cf141030da5ce7f962b369d1a0e45b77a057d481d SOURCES/glibc-upstream-2.34-373.patch
+44d26a1fe20b8853a48f470ead01e4279e869ac149b195dda4e44a195d981ab2 SOURCES/glibc-2.34.tar.xz
diff --git a/SOURCES/glibc-RHEL-1191.patch b/SOURCES/glibc-RHEL-1191.patch
new file mode 100644
index 0000000..3cb6635
--- /dev/null
+++ b/SOURCES/glibc-RHEL-1191.patch
@@ -0,0 +1,69 @@
+commit 1493622f4f9048ffede3fbedb64695efa49d662a
+Author: H.J. Lu <hjl.tools@gmail.com>
+Date:   Mon Aug 28 12:08:14 2023 -0700
+
+    x86: Check the lower byte of EAX of CPUID leaf 2 [BZ #30643]
+    
+    The old Intel software developer manual specified that the low byte of
+    EAX of CPUID leaf 2 returned 1 which indicated the number of rounds of
+    CPUDID leaf 2 was needed to retrieve the complete cache information. The
+    newer Intel manual has been changed to that it should always return 1
+    and be ignored.  If the lower byte isn't 1, CPUID leaf 2 can't be used.
+    In this case, we ignore CPUID leaf 2 and use CPUID leaf 4 instead.  If
+    CPUID leaf 4 doesn't contain the cache information, cache information
+    isn't available at all.  This addresses BZ #30643.
+
+diff --git a/sysdeps/x86/dl-cacheinfo.h b/sysdeps/x86/dl-cacheinfo.h
+index f950e488cfbe42dd..bd2f2b65f78056ca 100644
+--- a/sysdeps/x86/dl-cacheinfo.h
++++ b/sysdeps/x86/dl-cacheinfo.h
+@@ -187,7 +187,7 @@ intel_check_word (int name, unsigned int value, bool *has_level_2,
+ 	      ++round;
+ 	    }
+ 	  /* There is no other cache information anywhere else.  */
+-	  break;
++	  return -1;
+ 	}
+       else
+ 	{
+@@ -257,28 +257,23 @@ handle_intel (int name, const struct cpu_features *cpu_features)
+ 
+   /* OK, we can use the CPUID instruction to get all info about the
+      caches.  */
+-  unsigned int cnt = 0;
+-  unsigned int max = 1;
+   long int result = 0;
+   bool no_level_2_or_3 = false;
+   bool has_level_2 = false;
++  unsigned int eax;
++  unsigned int ebx;
++  unsigned int ecx;
++  unsigned int edx;
++  __cpuid (2, eax, ebx, ecx, edx);
+ 
+-  while (cnt++ < max)
++  /* The low byte of EAX of CPUID leaf 2 should always return 1 and it
++     should be ignored.  If it isn't 1, use CPUID leaf 4 instead.  */
++  if ((eax & 0xff) != 1)
++    return intel_check_word (name, 0xff, &has_level_2, &no_level_2_or_3,
++			     cpu_features);
++  else
+     {
+-      unsigned int eax;
+-      unsigned int ebx;
+-      unsigned int ecx;
+-      unsigned int edx;
+-      __cpuid (2, eax, ebx, ecx, edx);
+-
+-      /* The low byte of EAX in the first round contain the number of
+-	 rounds we have to make.  At least one, the one we are already
+-	 doing.  */
+-      if (cnt == 1)
+-	{
+-	  max = eax & 0xff;
+-	  eax &= 0xffffff00;
+-	}
++      eax &= 0xffffff00;
+ 
+       /* Process the individual registers' value.  */
+       result = intel_check_word (name, eax, &has_level_2,
diff --git a/SOURCES/glibc-RHEL-14383-1.patch b/SOURCES/glibc-RHEL-14383-1.patch
new file mode 100644
index 0000000..7a2e8d6
--- /dev/null
+++ b/SOURCES/glibc-RHEL-14383-1.patch
@@ -0,0 +1,72 @@
+commit 2aa0974d2573441bffd596b07bff8698b1f2f18c
+Author: Florian Weimer <fweimer@redhat.com>
+Date:   Fri Oct 20 14:29:50 2023 +0200
+
+    elf: ldconfig should skip temporary files created by package managers
+    
+    This avoids crashes due to partially written files, after a package
+    update is interrupted.
+    
+    Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+Conflicts:
+	elf/ldconfig.c
+	  (missing alloca removal downstream)
+
+diff --git a/elf/ldconfig.c b/elf/ldconfig.c
+index be47ad8c2d7f89f3..f0c811001965cc46 100644
+--- a/elf/ldconfig.c
++++ b/elf/ldconfig.c
+@@ -778,6 +778,31 @@ struct dlib_entry
+   struct dlib_entry *next;
+ };
+ 
++/* Skip some temporary DSO files.  These files may be partially written
++   and lead to ldconfig crashes when examined.  */
++static bool
++skip_dso_based_on_name (const char *name, size_t len)
++{
++  /* Skip temporary files created by the prelink program.  Files with
++     names like these are never really DSOs we want to look at.  */
++  if (len >= sizeof (".#prelink#") - 1)
++    {
++      if (strcmp (name + len - sizeof (".#prelink#") + 1,
++		  ".#prelink#") == 0)
++	return true;
++      if (len >= sizeof (".#prelink#.XXXXXX") - 1
++	  && memcmp (name + len - sizeof (".#prelink#.XXXXXX")
++		     + 1, ".#prelink#.", sizeof (".#prelink#.") - 1) == 0)
++	return true;
++    }
++  /* Skip temporary files created by RPM.  */
++  if (memchr (name, len, ';') != NULL)
++    return true;
++  /* Skip temporary files created by dpkg.  */
++  if (len > 4 && memcmp (name + len - 4, ".tmp", 4) == 0)
++    return true;
++  return false;
++}
+ 
+ static void
+ search_dir (const struct dir_entry *entry)
+@@ -854,18 +879,8 @@ search_dir (const struct dir_entry *entry)
+ 	continue;
+ 
+       size_t len = strlen (direntry->d_name);
+-      /* Skip temporary files created by the prelink program.  Files with
+-	 names like these are never really DSOs we want to look at.  */
+-      if (len >= sizeof (".#prelink#") - 1)
+-	{
+-	  if (strcmp (direntry->d_name + len - sizeof (".#prelink#") + 1,
+-		      ".#prelink#") == 0)
+-	    continue;
+-	  if (len >= sizeof (".#prelink#.XXXXXX") - 1
+-	      && memcmp (direntry->d_name + len - sizeof (".#prelink#.XXXXXX")
+-			 + 1, ".#prelink#.", sizeof (".#prelink#.") - 1) == 0)
+-	    continue;
+-	}
++      if (skip_dso_based_on_name (direntry->d_name, len))
++	continue;
+       len += strlen (entry->path) + 2;
+       if (len > file_name_len)
+ 	{
diff --git a/SOURCES/glibc-RHEL-14383-2.patch b/SOURCES/glibc-RHEL-14383-2.patch
new file mode 100644
index 0000000..4f68766
--- /dev/null
+++ b/SOURCES/glibc-RHEL-14383-2.patch
@@ -0,0 +1,61 @@
+commit cfb5a97a93ea656e3b2263e42142a4032986d9ba
+Author: Florian Weimer <fweimer@redhat.com>
+Date:   Mon Oct 23 12:53:16 2023 +0200
+
+    ldconfig: Fixes for skipping temporary files.
+    
+    Arguments to a memchr call were swapped, causing incorrect skipping
+    of files.
+    
+    Files related to dpkg have different names: they actually end in
+    .dpkg-new and .dpkg-tmp, not .tmp as I mistakenly assumed.
+    
+    Fixes commit 2aa0974d2573441bffd59 ("elf: ldconfig should skip
+    temporary files created by package managers").
+
+diff --git a/elf/ldconfig.c b/elf/ldconfig.c
+index f0c811001965cc46..4a96c409994d96c8 100644
+--- a/elf/ldconfig.c
++++ b/elf/ldconfig.c
+@@ -778,6 +778,17 @@ struct dlib_entry
+   struct dlib_entry *next;
+ };
+ 
++/* Return true if the N bytes at NAME end with with the characters in
++   the string SUFFIX.  (NAME[N + 1] does not have to be a null byte.)
++   Expected to be called with a string literal for SUFFIX.  */
++static inline bool
++endswithn (const char *name, size_t n, const char *suffix)
++{
++  return (n >= strlen (suffix)
++	  && memcmp (name + n - strlen (suffix), suffix,
++		     strlen (suffix)) == 0);
++}
++
+ /* Skip some temporary DSO files.  These files may be partially written
+    and lead to ldconfig crashes when examined.  */
+ static bool
+@@ -787,8 +798,7 @@ skip_dso_based_on_name (const char *name, size_t len)
+      names like these are never really DSOs we want to look at.  */
+   if (len >= sizeof (".#prelink#") - 1)
+     {
+-      if (strcmp (name + len - sizeof (".#prelink#") + 1,
+-		  ".#prelink#") == 0)
++      if (endswithn (name, len, ".#prelink#"))
+ 	return true;
+       if (len >= sizeof (".#prelink#.XXXXXX") - 1
+ 	  && memcmp (name + len - sizeof (".#prelink#.XXXXXX")
+@@ -796,10 +806,11 @@ skip_dso_based_on_name (const char *name, size_t len)
+ 	return true;
+     }
+   /* Skip temporary files created by RPM.  */
+-  if (memchr (name, len, ';') != NULL)
++  if (memchr (name, ';', len) != NULL)
+     return true;
+   /* Skip temporary files created by dpkg.  */
+-  if (len > 4 && memcmp (name + len - 4, ".tmp", 4) == 0)
++  if (endswithn (name, len, ".dpkg-new")
++      || endswithn (name, len, ".dpkg-tmp"))
+     return true;
+   return false;
+ }
diff --git a/SOURCES/glibc-RHEL-15343-1.patch b/SOURCES/glibc-RHEL-15343-1.patch
new file mode 100644
index 0000000..291e770
--- /dev/null
+++ b/SOURCES/glibc-RHEL-15343-1.patch
@@ -0,0 +1,26 @@
+commit 1626d8a521c7c771d4118b1328421fea113cab64
+Author: Joe Simmons-Talbott <josimmon@redhat.com>
+Date:   Fri Apr 21 09:24:22 2023 -0400
+
+    string: Allow use of test-string.h for non-ifunc implementations.
+    
+    Mark two variables as unused to silence warning when using
+    test-string.h for non-ifunc implementations.
+    
+    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+diff --git a/string/test-string.h b/string/test-string.h
+index 41de973479..8bcb8afd0a 100644
+--- a/string/test-string.h
++++ b/string/test-string.h
+@@ -130,8 +130,8 @@ cmdline_process_function (int c)
+ /* Increase size of FUNC_LIST if assert is triggered at run-time.  */
+ static struct libc_ifunc_impl func_list[32];
+ static int func_count;
+-static int impl_count = -1;
+-static impl_t *impl_array;
++static int impl_count __attribute__ ((unused)) = -1;
++static impl_t *impl_array __attribute__ ((unused));
+ 
+ # define FOR_EACH_IMPL(impl, notall) \
+   impl_t *impl;								\
diff --git a/SOURCES/glibc-RHEL-15343-2.patch b/SOURCES/glibc-RHEL-15343-2.patch
new file mode 100644
index 0000000..2110e90
--- /dev/null
+++ b/SOURCES/glibc-RHEL-15343-2.patch
@@ -0,0 +1,233 @@
+commit eaaad78db41724e5a18a42becb238bfc4e683998
+Author: Joe Simmons-Talbott <josimmon@redhat.com>
+Date:   Fri Apr 21 09:24:23 2023 -0400
+
+    string: Add tests for strdup (BZ #30266)
+    
+    Copy strcpy tests for strdup.  Covers some basic testcases with random
+    strings.  Add a zero-length string testcase.
+    
+    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+    Conflicts:
+        string/Makefile
+          (different test backport order)
+
+
+diff -Nrup a/string/Makefile b/string/Makefile
+--- a/string/Makefile	2023-11-30 10:59:16.400251685 -0500
++++ b/string/Makefile	2023-11-30 11:16:42.829613344 -0500
+@@ -63,7 +63,8 @@ tests		:= tester inl-tester noinl-tester
+ 		   tst-strtok_r bug-strcoll2 tst-cmp tst-xbzero-opt	\
+ 		   test-endian-types test-endian-file-scope		\
+ 		   test-endian-sign-conversion tst-memmove-overflow	\
+-		   test-sig_np tst-strerror-fail
++		   test-sig_np tst-strerror-fail			\
++		   test-strdup
+ 
+ # Both tests require the .mo translation files generated by msgfmt.
+ tests-translation := tst-strsignal					\
+diff -Nrup a/string/test-strdup.c b/string/test-strdup.c
+--- a/string/test-strdup.c	1969-12-31 19:00:00.000000000 -0500
++++ b/string/test-strdup.c	2023-11-30 11:11:32.850447614 -0500
+@@ -0,0 +1,201 @@
++/* Test and measure strdup functions.
++   Copyright (C) 2023 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 <support/check.h>
++
++#ifdef WIDE
++# include <wchar.h>
++# define CHAR wchar_t
++# define sfmt "ls"
++# define BIG_CHAR WCHAR_MAX
++# define SMALL_CHAR 1273
++# define STRCMP wcscmp
++# define MEMCMP wmemcmp
++# define MEMSET wmemset
++# define TCS TEST_COMPARE_STRING_WIDE
++#else
++# define CHAR char
++# define sfmt "s"
++# define BIG_CHAR CHAR_MAX
++# define SMALL_CHAR 127
++# define STRCMP strcmp
++# define MEMCMP memcmp
++# define MEMSET memset
++# define TCS TEST_COMPARE_STRING
++#endif
++
++#ifndef STRDUP_RESULT
++# define STRDUP_RESULT(dst, len) dst
++# define TEST_MAIN
++# ifndef WIDE
++#  define TEST_NAME "strdup"
++# else
++#  define TEST_NAME "wcsdup"
++# endif
++# include "test-string.h"
++# ifndef WIDE
++#  define STRDUP strdup
++# else
++#  define STRDUP wcsdup
++# endif
++#endif
++
++typedef CHAR *(*proto_t) (const CHAR *);
++
++static void
++do_zero_len_test (void)
++{
++  CHAR src[1] = { '\0' };
++  CHAR *dst = STRDUP (src);
++
++  TCS (dst, src);
++  free (dst);
++}
++
++static void
++do_one_test (const CHAR *src,
++	     size_t len __attribute__((unused)))
++{
++  CHAR *dst = STRDUP (src);
++
++  if (STRCMP (dst, src) != 0)
++    {
++      error (0, 0,
++	     "Wrong result in function %s dst \"%" sfmt "\" src \"%" sfmt "\"",
++	     TEST_NAME, dst, src);
++      ret = 1;
++      free (dst);
++      return;
++    }
++  free (dst);
++}
++
++static void
++do_test (size_t align1, size_t align2, size_t len, int max_char)
++{
++  size_t i;
++  CHAR *s1;
++/* For wcsdup: align1 and align2 here mean alignment not in bytes,
++   but in wchar_ts, in bytes it will equal to align * (sizeof (wchar_t))
++   len for wcschr here isn't in bytes but it's number of wchar_t symbols.  */
++  align1 &= 7;
++  if ((align1 + len) * sizeof (CHAR) >= page_size)
++    return;
++
++  align2 &= 7;
++  if ((align2 + len) * sizeof (CHAR) >= page_size)
++    return;
++
++  s1 = (CHAR *) (buf1) + align1;
++
++  for (i = 0; i < len; i++)
++    s1[i] = 32 + 23 * i % (max_char - 32);
++  s1[len] = 0;
++
++  do_one_test (s1, len);
++}
++
++static void
++do_random_tests (void)
++{
++  size_t i, j, n, align1, align2, len;
++  CHAR *p1 = (CHAR *)(buf1 + page_size) - 512;
++  CHAR *res;
++
++  for (n = 0; n < ITERATIONS; n++)
++    {
++      /* align1 and align2 are expressed as wchar_t and not in bytes for wide
++     char test, and thus it will be equal to align times wchar_t size.
++
++     For non wide version we need to check all alignments from 0 to 63
++     since some assembly implementations have separate prolog for alignments
++     more 48.  */
++
++      align1 = random () & (63 / sizeof (CHAR));
++      if (random () & 1)
++	align2 = random () & (63 / sizeof (CHAR));
++      else
++	align2 = align1 + (random () & 24);
++      len = random () & 511;
++      j = align1;
++      if (align2 > j)
++	j = align2;
++      if (len + j >= 511)
++	len = 510 - j - (random () & 7);
++      j = len + align1 + 64;
++      if (j > 512)
++	j = 512;
++      for (i = 0; i < j; i++)
++	{
++	  if (i == len + align1)
++	    p1[i] = 0;
++	  else
++	    {
++	      p1[i] = random () & BIG_CHAR;
++	      if (i >= align1 && i < len + align1 && !p1[i])
++		p1[i] = (random () & SMALL_CHAR) + 3;
++	    }
++	}
++
++      res =  STRDUP(p1 + align1);
++      TCS (res, (p1 + align1));
++      free (res);
++    }
++}
++
++
++int
++test_main (void)
++{
++  size_t i;
++
++  test_init ();
++
++  printf ("%23s", "");
++  printf ("\t%s", TEST_NAME);
++  putchar ('\n');
++
++  for (i = 0; i < 16; ++i)
++    {
++      do_test (0, 0, i, SMALL_CHAR);
++      do_test (0, 0, i, BIG_CHAR);
++      do_test (0, i, i, SMALL_CHAR);
++      do_test (i, 0, i, BIG_CHAR);
++    }
++
++  for (i = 1; i < 8; ++i)
++    {
++      do_test (0, 0, 8 << i, SMALL_CHAR);
++      do_test (8 - i, 2 * i, 8 << i, SMALL_CHAR);
++    }
++
++  for (i = 1; i < 8; ++i)
++    {
++      do_test (i, 2 * i, 8 << i, SMALL_CHAR);
++      do_test (2 * i, i, 8 << i, BIG_CHAR);
++      do_test (i, i, 8 << i, SMALL_CHAR);
++      do_test (i, i, 8 << i, BIG_CHAR);
++    }
++
++  do_zero_len_test ();
++  do_random_tests ();
++
++  return ret;
++}
++
++#include <support/test-driver.c>
diff --git a/SOURCES/glibc-RHEL-15343-3.patch b/SOURCES/glibc-RHEL-15343-3.patch
new file mode 100644
index 0000000..8cac6d9
--- /dev/null
+++ b/SOURCES/glibc-RHEL-15343-3.patch
@@ -0,0 +1,232 @@
+commit 0c48aa0551151ea201f7f528492e89a0b08a6890
+Author: Joe Simmons-Talbott <josimmon@redhat.com>
+Date:   Fri Apr 21 09:24:24 2023 -0400
+
+    string: Add tests for strndup (BZ #30266)
+    
+    Copy strncpy tests for strndup.  Covers some basic testcases with random
+    strings.  Remove tests that set the destination's bytes and checked the
+    resulting buffer's bytes.  Remove wide character test support since
+    wcsndup() doesn't exist.
+    
+    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+    Conflicts:
+	string/Makefile
+	  (different test backport order)
+
+diff -Nrup a/string/Makefile b/string/Makefile
+--- a/string/Makefile	2023-11-30 11:55:02.263010916 -0500
++++ b/string/Makefile	2023-11-30 11:58:29.238954539 -0500
+@@ -64,7 +64,7 @@ tests		:= tester inl-tester noinl-tester
+ 		   test-endian-types test-endian-file-scope		\
+ 		   test-endian-sign-conversion tst-memmove-overflow	\
+ 		   test-sig_np tst-strerror-fail			\
+-		   test-strdup
++		   test-strdup test-strndup
+ 
+ # Both tests require the .mo translation files generated by msgfmt.
+ tests-translation := tst-strsignal					\
+diff -Nrup a/string/test-strndup.c b/string/test-strndup.c
+--- a/string/test-strndup.c	1969-12-31 19:00:00.000000000 -0500
++++ b/string/test-strndup.c	2023-11-30 11:56:24.986388053 -0500
+@@ -0,0 +1,200 @@
++/* Test strndup functions.
++   Copyright (C) 2023 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 <support/check.h>
++
++#define TEST_MAIN
++#include "test-string.h"
++
++static void
++do_one_test (const char *src, size_t len, size_t n)
++{
++  char *dst = strndup (src, n);
++  size_t s = (len > n ? n: len) * sizeof (char);
++
++  TEST_COMPARE_BLOB (dst, s, src, s);
++
++  free (dst);
++}
++
++static void
++do_test (size_t align1, size_t align2, size_t len, size_t n, int max_char)
++{
++  size_t i;
++  char *s1;
++
++  align1 &= 7;
++  if ((align1 + len) * sizeof (char) >= page_size)
++    return;
++
++  align2 &= 7;
++  if ((align2 + len) * sizeof (char) >= page_size)
++    return;
++
++  s1 = (char *) (buf1) + align1;
++
++  for (i = 0; i < len; ++i)
++    s1[i] = 32 + 23 * i % (max_char - 32);
++  s1[len] = 0;
++  for (i = len + 1; (i + align1) * sizeof (char) < page_size && i < len + 64;
++       ++i)
++    s1[i] = 32 + 32 * i % (max_char - 32);
++
++  do_one_test (s1, len, n);
++}
++
++static void
++do_page_tests (void)
++{
++  char *s1;
++  const size_t maxoffset = 64;
++
++  /* Put s1 at the maxoffset from the edge of buf1's last page.  */
++  s1 = (char *) buf1 + BUF1PAGES * page_size / sizeof (char) - maxoffset;
++
++  memset (s1, 'a', maxoffset - 1);
++  s1[maxoffset - 1] = '\0';
++
++  /* Both strings are bounded to a page with read/write access and the next
++     page is protected with PROT_NONE (meaning that any access outside of the
++     page regions will trigger an invalid memory access).
++
++     The loop copies the string s1 for all possible offsets up to maxoffset
++     for both inputs with a size larger than s1 (so memory access outside the
++     expected memory regions might trigger invalid access).  */
++
++  for (size_t off1 = 0; off1 < maxoffset; off1++)
++    for (size_t off2 = 0; off2 < maxoffset; off2++)
++      do_one_test (s1 + off1, maxoffset - off1 - 1,
++		   maxoffset + (maxoffset - off2));
++}
++
++static void
++do_random_tests (void)
++{
++  size_t i, j, n, align1, align2, len, size, mode;
++  char *p1 = (char *) (buf1 + page_size) - 512;
++  char *res;
++
++  for (n = 0; n < ITERATIONS; n++)
++    {
++      mode = random ();
++      if (mode & 1)
++	{
++	  size = random () & 255;
++	  align1 = 512 - size - (random () & 15);
++	  if (mode & 2)
++	    align2 = align1 - (random () & 24);
++	  else
++	    align2 = align1 - (random () & 31);
++	  if (mode & 4)
++	    {
++	      j = align1;
++	      align1 = align2;
++	      align2 = j;
++	    }
++	  if (mode & 8)
++	    len = size - (random () & 31);
++	  else
++	    len = 512;
++	  if (len >= 512)
++	    len = random () & 511;
++	}
++      else
++	{
++	  align1 = random () & 31;
++	  if (mode & 2)
++	    align2 = random () & 31;
++	  else
++	    align2 = align1 + (random () & 24);
++	  len = random () & 511;
++	  j = align1;
++	  if (align2 > j)
++	    j = align2;
++	  if (mode & 4)
++	    {
++	      size = random () & 511;
++	      if (size + j > 512)
++		size = 512 - j - (random () & 31);
++	    }
++	  else
++	    size = 512 - j;
++	  if ((mode & 8) && len + j >= 512)
++	    len = 512 - j - (random () & 7);
++	}
++      j = len + align1 + 64;
++      if (j > 512)
++	j = 512;
++      for (i = 0; i < j; i++)
++	{
++	  if (i == len + align1)
++	    p1[i] = 0;
++	  else
++	    {
++	      p1[i] = random () & CHAR_MAX;
++	      if (i >= align1 && i < len + align1 && !p1[i])
++		p1[i] = (random () & 127) + 3;
++	    }
++	}
++
++	res = (char *) strndup ((char *) (p1 + align1), size);
++	j = len + 1;
++	if (size < j)
++	  j = size;
++	TEST_COMPARE_BLOB (res, j, (char *) (p1 + align1), j);
++	free (res);
++    }
++}
++
++int
++test_main (void)
++{
++  size_t i;
++
++  test_init ();
++
++  printf ("%28s", "");
++  printf ("\t%s", "strndup");
++  putchar ('\n');
++
++  for (i = 1; i < 8; ++i)
++    {
++      do_test (i, i, 16, 16, 127);
++      do_test (i, i, 16, 16, CHAR_MAX);
++      do_test (i, 2 * i, 16, 16, 127);
++      do_test (2 * i, i, 16, 16, CHAR_MAX);
++      do_test (8 - i, 2 * i, 1 << i, 2 << i, 127);
++      do_test (2 * i, 8 - i, 2 << i, 1 << i, 127);
++      do_test (8 - i, 2 * i, 1 << i, 2 << i, CHAR_MAX);
++      do_test (2 * i, 8 - i, 2 << i, 1 << i, CHAR_MAX);
++    }
++
++  for (i = 1; i < 8; ++i)
++    {
++      do_test (0, 0, 4 << i, 8 << i, 127);
++      do_test (0, 0, 16 << i, 8 << i, 127);
++      do_test (8 - i, 2 * i, 4 << i, 8 << i, 127);
++      do_test (8 - i, 2 * i, 16 << i, 8 << i, 127);
++    }
++
++  do_random_tests ();
++  do_page_tests ();
++  return ret;
++}
++
++#include <support/test-driver.c>
diff --git a/SOURCES/glibc-RHEL-15343-4.patch b/SOURCES/glibc-RHEL-15343-4.patch
new file mode 100644
index 0000000..cd2a826
--- /dev/null
+++ b/SOURCES/glibc-RHEL-15343-4.patch
@@ -0,0 +1,33 @@
+commit 0aa5b28a504c6f1f17b387d8147715d1496fff62
+Author: Joe Simmons-Talbott <josimmon@redhat.com>
+Date:   Fri Apr 21 09:24:25 2023 -0400
+
+    wcsmbs: Add wcsdup() tests. (BZ #30266)
+    
+    Enable wide character testcases for wcsdup().
+    
+    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+    Conflicts:
+	wcsmbs/Makefile
+          (different test backport order)
+
+
+diff -Nrup a/wcsmbs/Makefile b/wcsmbs/Makefile
+--- a/wcsmbs/Makefile	2023-11-30 14:14:18.755010508 -0500
++++ b/wcsmbs/Makefile	2023-11-30 14:38:18.511131851 -0500
+@@ -53,7 +53,8 @@ tests := tst-wcstof wcsmbs-tst1 tst-wcsn
+ 	 tst-c16c32-1 wcsatcliff tst-wcstol-locale tst-wcstod-nan-locale \
+ 	 tst-wcstod-round test-char-types tst-fgetwc-after-eof \
+ 	 tst-wcstod-nan-sign tst-c16-surrogate tst-c32-state \
+-	 $(addprefix test-,$(strop-tests)) tst-mbstowcs
++	 $(addprefix test-,$(strop-tests)) tst-mbstowcs \
++	 test-wcsdup
+ 
+ include ../Rules
+ 
+diff -Nrup a/wcsmbs/test-wcsdup.c b/wcsmbs/test-wcsdup.c
+--- a/wcsmbs/test-wcsdup.c	1969-12-31 19:00:00.000000000 -0500
++++ b/wcsmbs/test-wcsdup.c	2023-11-30 14:14:48.869138712 -0500
+@@ -0,0 +1,2 @@
++#define WIDE 1
++#include "../string/test-strdup.c"
diff --git a/SOURCES/glibc-RHEL-16016-1.patch b/SOURCES/glibc-RHEL-16016-1.patch
new file mode 100644
index 0000000..4dc5c5f
--- /dev/null
+++ b/SOURCES/glibc-RHEL-16016-1.patch
@@ -0,0 +1,26 @@
+commit 919b9bfaa969c9517fe86c753c001b96ee4ea840
+Author: Joseph Myers <joseph@codesourcery.com>
+Date:   Wed Oct 5 14:33:14 2022 +0000
+
+    Update syscall lists for Linux 6.0
+    
+    Linux 6.0 has no new syscalls.  Update the version number in
+    syscall-names.list to reflect that it is still current for 6.0.
+    
+    Tested with build-many-glibcs.py.
+
+diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list
+index 028ad3107a..4a78258646 100644
+--- a/sysdeps/unix/sysv/linux/syscall-names.list
++++ b/sysdeps/unix/sysv/linux/syscall-names.list
+@@ -21,8 +21,8 @@
+ # This file can list all potential system calls.  The names are only
+ # used if the installed kernel headers also provide them.
+ 
+-# The list of system calls is current as of Linux 5.19.
+-kernel 5.19
++# The list of system calls is current as of Linux 6.0.
++kernel 6.0
+ 
+ FAST_atomic_update
+ FAST_cmpxchg
diff --git a/SOURCES/glibc-RHEL-16016-2.patch b/SOURCES/glibc-RHEL-16016-2.patch
new file mode 100644
index 0000000..18ce2c3
--- /dev/null
+++ b/SOURCES/glibc-RHEL-16016-2.patch
@@ -0,0 +1,24 @@
+commit 5ab9b2c92411eb52f7b7a8e6074f0740d9bd727b
+Author: Joseph Myers <joseph@codesourcery.com>
+Date:   Tue Dec 20 15:24:29 2022 +0000
+
+    Update syscall lists for Linux 6.1
+    
+    Linux 6.1 has no new syscalls.  Update the version number in
+    syscall-names.list to reflect that it is still current for 6.1.
+
+diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list
+index 4a78258646..1274d9cd4a 100644
+--- a/sysdeps/unix/sysv/linux/syscall-names.list
++++ b/sysdeps/unix/sysv/linux/syscall-names.list
+@@ -21,8 +21,8 @@
+ # This file can list all potential system calls.  The names are only
+ # used if the installed kernel headers also provide them.
+ 
+-# The list of system calls is current as of Linux 6.0.
+-kernel 6.0
++# The list of system calls is current as of Linux 6.1.
++kernel 6.1
+ 
+ FAST_atomic_update
+ FAST_cmpxchg
diff --git a/SOURCES/glibc-RHEL-16016-3.patch b/SOURCES/glibc-RHEL-16016-3.patch
new file mode 100644
index 0000000..9e9fd03
--- /dev/null
+++ b/SOURCES/glibc-RHEL-16016-3.patch
@@ -0,0 +1,26 @@
+commit f8e8effa2629c74769a3552aba33175746b710bb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date:   Thu Feb 23 22:53:17 2023 +0000
+
+    Update syscall lists for Linux 6.2
+    
+    Linux 6.2 has no new syscalls.  Update the version number in
+    syscall-names.list to reflect that it is still current for 6.2.
+    
+    Tested with build-many-glibcs.py.
+
+diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list
+index 822498d3e3..5d27b5279c 100644
+--- a/sysdeps/unix/sysv/linux/syscall-names.list
++++ b/sysdeps/unix/sysv/linux/syscall-names.list
+@@ -21,8 +21,8 @@
+ # This file can list all potential system calls.  The names are only
+ # used if the installed kernel headers also provide them.
+ 
+-# The list of system calls is current as of Linux 6.1.
+-kernel 6.1
++# The list of system calls is current as of Linux 6.2.
++kernel 6.2
+ 
+ FAST_atomic_update
+ FAST_cmpxchg
diff --git a/SOURCES/glibc-RHEL-16016-4.patch b/SOURCES/glibc-RHEL-16016-4.patch
new file mode 100644
index 0000000..b043c5c
--- /dev/null
+++ b/SOURCES/glibc-RHEL-16016-4.patch
@@ -0,0 +1,26 @@
+commit eeef96f56ce399f2c3fc1d93c0ba1dde34f3ae41
+Author: Joseph Myers <joseph@codesourcery.com>
+Date:   Mon May 15 22:26:56 2023 +0000
+
+    Update syscall lists for Linux 6.3
+    
+    Linux 6.3 has no new syscalls.  Update the version number in
+    syscall-names.list to reflect that it is still current for 6.3.
+    
+    Tested with build-many-glibcs.py.
+
+diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list
+index 5d27b5279c..72fe1d5efe 100644
+--- a/sysdeps/unix/sysv/linux/syscall-names.list
++++ b/sysdeps/unix/sysv/linux/syscall-names.list
+@@ -21,8 +21,8 @@
+ # This file can list all potential system calls.  The names are only
+ # used if the installed kernel headers also provide them.
+ 
+-# The list of system calls is current as of Linux 6.2.
+-kernel 6.2
++# The list of system calls is current as of Linux 6.3.
++kernel 6.3
+ 
+ FAST_atomic_update
+ FAST_cmpxchg
diff --git a/SOURCES/glibc-RHEL-16016-5.patch b/SOURCES/glibc-RHEL-16016-5.patch
new file mode 100644
index 0000000..8bf1ec7
--- /dev/null
+++ b/SOURCES/glibc-RHEL-16016-5.patch
@@ -0,0 +1,83 @@
+commit 1a21693e16a3f3d10f41c486b97fbecb53dd2087
+Author: Joseph Myers <joseph@codesourcery.com>
+Date:   Wed Jun 28 21:22:14 2023 +0000
+
+    Update syscall lists for Linux 6.4
+    
+    Linux 6.4 adds the riscv_hwprobe syscall on riscv and enables
+    memfd_secret on s390.  Update syscall-names.list and regenerate the
+    arch-syscall.h headers with build-many-glibcs.py update-syscalls.
+    
+    Tested with build-many-glibcs.py.
+
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+index 202520ee25..2416e041c8 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+@@ -198,6 +198,7 @@
+ #define __NR_request_key 218
+ #define __NR_restart_syscall 128
+ #define __NR_riscv_flush_icache 259
++#define __NR_riscv_hwprobe 258
+ #define __NR_rseq 293
+ #define __NR_rt_sigaction 134
+ #define __NR_rt_sigpending 136
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+index 4e65f337d4..a32bc82f60 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+@@ -205,6 +205,7 @@
+ #define __NR_request_key 218
+ #define __NR_restart_syscall 128
+ #define __NR_riscv_flush_icache 259
++#define __NR_riscv_hwprobe 258
+ #define __NR_rseq 293
+ #define __NR_rt_sigaction 134
+ #define __NR_rt_sigpending 136
+diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h b/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h
+index 57025107e8..2288f20e45 100644
+--- a/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h
+@@ -178,6 +178,7 @@
+ #define __NR_mbind 268
+ #define __NR_membarrier 356
+ #define __NR_memfd_create 350
++#define __NR_memfd_secret 447
+ #define __NR_migrate_pages 287
+ #define __NR_mincore 218
+ #define __NR_mkdir 39
+diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h b/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h
+index 72e19c6d56..05e6d8428e 100644
+--- a/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h
+@@ -152,6 +152,7 @@
+ #define __NR_mbind 268
+ #define __NR_membarrier 356
+ #define __NR_memfd_create 350
++#define __NR_memfd_secret 447
+ #define __NR_migrate_pages 287
+ #define __NR_mincore 218
+ #define __NR_mkdir 39
+diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list
+index 72fe1d5efe..5b69106434 100644
+--- a/sysdeps/unix/sysv/linux/syscall-names.list
++++ b/sysdeps/unix/sysv/linux/syscall-names.list
+@@ -21,8 +21,8 @@
+ # This file can list all potential system calls.  The names are only
+ # used if the installed kernel headers also provide them.
+ 
+-# The list of system calls is current as of Linux 6.3.
+-kernel 6.3
++# The list of system calls is current as of Linux 6.4.
++kernel 6.4
+ 
+ FAST_atomic_update
+ FAST_cmpxchg
+@@ -477,6 +477,7 @@ renameat2
+ request_key
+ restart_syscall
+ riscv_flush_icache
++riscv_hwprobe
+ rmdir
+ rseq
+ rt_sigaction
diff --git a/SOURCES/glibc-RHEL-16016-6.patch b/SOURCES/glibc-RHEL-16016-6.patch
new file mode 100644
index 0000000..342a502
--- /dev/null
+++ b/SOURCES/glibc-RHEL-16016-6.patch
@@ -0,0 +1,338 @@
+commit 72511f539cc34681ec61c6a0dc2fe6d684760ffe
+Author: Joseph Myers <joseph@codesourcery.com>
+Date:   Tue Sep 12 14:08:53 2023 +0000
+
+    Update syscall lists for Linux 6.5
+    
+    Linux 6.5 has one new syscall, cachestat, and also enables the
+    cacheflush syscall for hppa.  Update syscall-names.list and regenerate
+    the arch-syscall.h headers with build-many-glibcs.py update-syscalls.
+    
+    Tested with build-many-glibcs.py.
+    
+    Conflicts: Removed loongarch, or1k
+
+diff --git a/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h b/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h
+index 4fcb6da80a..8f21ee66a0 100644
+--- a/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h
+@@ -7,6 +7,7 @@
+ #define __NR_bind 200
+ #define __NR_bpf 280
+ #define __NR_brk 214
++#define __NR_cachestat 451
+ #define __NR_capget 90
+ #define __NR_capset 91
+ #define __NR_chdir 49
+diff --git a/sysdeps/unix/sysv/linux/alpha/arch-syscall.h b/sysdeps/unix/sysv/linux/alpha/arch-syscall.h
+index 0cf74c1a96..c5802a5fec 100644
+--- a/sysdeps/unix/sysv/linux/alpha/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/alpha/arch-syscall.h
+@@ -11,6 +11,7 @@
+ #define __NR_bind 104
+ #define __NR_bpf 515
+ #define __NR_brk 17
++#define __NR_cachestat 561
+ #define __NR_capget 368
+ #define __NR_capset 369
+ #define __NR_chdir 12
+diff --git a/sysdeps/unix/sysv/linux/arc/arch-syscall.h b/sysdeps/unix/sysv/linux/arc/arch-syscall.h
+index c1207aaa12..f23f9e1154 100644
+--- a/sysdeps/unix/sysv/linux/arc/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/arc/arch-syscall.h
+@@ -11,6 +11,7 @@
+ #define __NR_bpf 280
+ #define __NR_brk 214
+ #define __NR_cacheflush 244
++#define __NR_cachestat 451
+ #define __NR_capget 90
+ #define __NR_capset 91
+ #define __NR_chdir 49
+diff --git a/sysdeps/unix/sysv/linux/arm/arch-syscall.h b/sysdeps/unix/sysv/linux/arm/arch-syscall.h
+index e7ba04c106..7edf574899 100644
+--- a/sysdeps/unix/sysv/linux/arm/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/arm/arch-syscall.h
+@@ -15,6 +15,7 @@
+ #define __NR_bpf 386
+ #define __NR_brk 45
+ #define __NR_cacheflush 983042
++#define __NR_cachestat 451
+ #define __NR_capget 184
+ #define __NR_capset 185
+ #define __NR_chdir 12
+diff --git a/sysdeps/unix/sysv/linux/csky/arch-syscall.h b/sysdeps/unix/sysv/linux/csky/arch-syscall.h
+index dc9383758e..d74a06e063 100644
+--- a/sysdeps/unix/sysv/linux/csky/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/csky/arch-syscall.h
+@@ -8,6 +8,7 @@
+ #define __NR_bpf 280
+ #define __NR_brk 214
+ #define __NR_cacheflush 245
++#define __NR_cachestat 451
+ #define __NR_capget 90
+ #define __NR_capset 91
+ #define __NR_chdir 49
+diff --git a/sysdeps/unix/sysv/linux/hppa/arch-syscall.h b/sysdeps/unix/sysv/linux/hppa/arch-syscall.h
+index 767f1287a3..5568b94cd3 100644
+--- a/sysdeps/unix/sysv/linux/hppa/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/hppa/arch-syscall.h
+@@ -13,6 +13,8 @@
+ #define __NR_bind 22
+ #define __NR_bpf 341
+ #define __NR_brk 45
++#define __NR_cacheflush 356
++#define __NR_cachestat 451
+ #define __NR_capget 106
+ #define __NR_capset 107
+ #define __NR_chdir 12
+diff --git a/sysdeps/unix/sysv/linux/i386/arch-syscall.h b/sysdeps/unix/sysv/linux/i386/arch-syscall.h
+index 1998f0d76a..3af21a15cb 100644
+--- a/sysdeps/unix/sysv/linux/i386/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/i386/arch-syscall.h
+@@ -15,6 +15,7 @@
+ #define __NR_bpf 357
+ #define __NR_break 17
+ #define __NR_brk 45
++#define __NR_cachestat 451
+ #define __NR_capget 184
+ #define __NR_capset 185
+ #define __NR_chdir 12
+diff --git a/sysdeps/unix/sysv/linux/ia64/arch-syscall.h b/sysdeps/unix/sysv/linux/ia64/arch-syscall.h
+index b2eab1b93d..39b270e642 100644
+--- a/sysdeps/unix/sysv/linux/ia64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/ia64/arch-syscall.h
+@@ -11,6 +11,7 @@
+ #define __NR_bind 1191
+ #define __NR_bpf 1341
+ #define __NR_brk 1060
++#define __NR_cachestat 1475
+ #define __NR_capget 1185
+ #define __NR_capset 1186
+ #define __NR_chdir 1034
+diff --git a/sysdeps/unix/sysv/linux/m68k/arch-syscall.h b/sysdeps/unix/sysv/linux/m68k/arch-syscall.h
+index 5fc3723772..315e49cd33 100644
+--- a/sysdeps/unix/sysv/linux/m68k/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/m68k/arch-syscall.h
+@@ -15,6 +15,7 @@
+ #define __NR_bpf 354
+ #define __NR_brk 45
+ #define __NR_cacheflush 123
++#define __NR_cachestat 451
+ #define __NR_capget 184
+ #define __NR_capset 185
+ #define __NR_chdir 12
+diff --git a/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h b/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h
+index b6e9b007e4..54af12780c 100644
+--- a/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h
+@@ -15,6 +15,7 @@
+ #define __NR_bpf 387
+ #define __NR_break 17
+ #define __NR_brk 45
++#define __NR_cachestat 451
+ #define __NR_capget 184
+ #define __NR_capset 185
+ #define __NR_chdir 12
+diff --git a/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h b/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h
+index b3a3871f8a..a2aa1ffa1b 100644
+--- a/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h
+@@ -17,6 +17,7 @@
+ #define __NR_brk 4045
+ #define __NR_cachectl 4148
+ #define __NR_cacheflush 4147
++#define __NR_cachestat 4451
+ #define __NR_capget 4204
+ #define __NR_capset 4205
+ #define __NR_chdir 4012
+diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h
+index b462182723..5bec858040 100644
+--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h
+@@ -14,6 +14,7 @@
+ #define __NR_brk 6012
+ #define __NR_cachectl 6198
+ #define __NR_cacheflush 6197
++#define __NR_cachestat 6451
+ #define __NR_capget 6123
+ #define __NR_capset 6124
+ #define __NR_chdir 6078
+diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h
+index a9d6b94572..0166371ee2 100644
+--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h
+@@ -14,6 +14,7 @@
+ #define __NR_brk 5012
+ #define __NR_cachectl 5198
+ #define __NR_cacheflush 5197
++#define __NR_cachestat 5451
+ #define __NR_capget 5123
+ #define __NR_capset 5124
+ #define __NR_chdir 5078
+diff --git a/sysdeps/unix/sysv/linux/nios2/arch-syscall.h b/sysdeps/unix/sysv/linux/nios2/arch-syscall.h
+index 809a219ef3..29a4cfa988 100644
+--- a/sysdeps/unix/sysv/linux/nios2/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/nios2/arch-syscall.h
+@@ -8,6 +8,7 @@
+ #define __NR_bpf 280
+ #define __NR_brk 214
+ #define __NR_cacheflush 244
++#define __NR_cachestat 451
+ #define __NR_capget 90
+ #define __NR_capset 91
+ #define __NR_chdir 49
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h
+index 627831ebae..3a212a0269 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h
+@@ -15,6 +15,7 @@
+ #define __NR_bpf 361
+ #define __NR_break 17
+ #define __NR_brk 45
++#define __NR_cachestat 451
+ #define __NR_capget 183
+ #define __NR_capset 184
+ #define __NR_chdir 12
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h
+index bae597199d..1038ead227 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h
+@@ -15,6 +15,7 @@
+ #define __NR_bpf 361
+ #define __NR_break 17
+ #define __NR_brk 45
++#define __NR_cachestat 451
+ #define __NR_capget 183
+ #define __NR_capset 184
+ #define __NR_chdir 12
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+index 2416e041c8..57b043ffb5 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+@@ -6,6 +6,7 @@
+ #define __NR_bind 200
+ #define __NR_bpf 280
+ #define __NR_brk 214
++#define __NR_cachestat 451
+ #define __NR_capget 90
+ #define __NR_capset 91
+ #define __NR_chdir 49
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+index a32bc82f60..1041a0f8c9 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+@@ -7,6 +7,7 @@
+ #define __NR_bind 200
+ #define __NR_bpf 280
+ #define __NR_brk 214
++#define __NR_cachestat 451
+ #define __NR_capget 90
+ #define __NR_capset 91
+ #define __NR_chdir 49
+diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h b/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h
+index 2288f20e45..70d4c6782e 100644
+--- a/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h
+@@ -13,6 +13,7 @@
+ #define __NR_bind 361
+ #define __NR_bpf 351
+ #define __NR_brk 45
++#define __NR_cachestat 451
+ #define __NR_capget 184
+ #define __NR_capset 185
+ #define __NR_chdir 12
+diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h b/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h
+index 05e6d8428e..65a8a9e316 100644
+--- a/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h
+@@ -11,6 +11,7 @@
+ #define __NR_bind 361
+ #define __NR_bpf 351
+ #define __NR_brk 45
++#define __NR_cachestat 451
+ #define __NR_capget 184
+ #define __NR_capset 185
+ #define __NR_chdir 12
+diff --git a/sysdeps/unix/sysv/linux/sh/arch-syscall.h b/sysdeps/unix/sysv/linux/sh/arch-syscall.h
+index d52b522d9c..94aad0f119 100644
+--- a/sysdeps/unix/sysv/linux/sh/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/sh/arch-syscall.h
+@@ -14,6 +14,7 @@
+ #define __NR_bpf 375
+ #define __NR_brk 45
+ #define __NR_cacheflush 123
++#define __NR_cachestat 451
+ #define __NR_capget 184
+ #define __NR_capset 185
+ #define __NR_chdir 12
+diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h b/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h
+index d3f4d8aa3e..d630306c75 100644
+--- a/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h
+@@ -14,6 +14,7 @@
+ #define __NR_bind 353
+ #define __NR_bpf 349
+ #define __NR_brk 17
++#define __NR_cachestat 451
+ #define __NR_capget 21
+ #define __NR_capset 22
+ #define __NR_chdir 12
+diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h b/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h
+index 2cc03d7a24..930f29b4d2 100644
+--- a/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h
+@@ -14,6 +14,7 @@
+ #define __NR_bind 353
+ #define __NR_bpf 349
+ #define __NR_brk 17
++#define __NR_cachestat 451
+ #define __NR_capget 21
+ #define __NR_capset 22
+ #define __NR_chdir 12
+diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list
+index 5b69106434..cf6f70ecd9 100644
+--- a/sysdeps/unix/sysv/linux/syscall-names.list
++++ b/sysdeps/unix/sysv/linux/syscall-names.list
+@@ -21,8 +21,8 @@
+ # This file can list all potential system calls.  The names are only
+ # used if the installed kernel headers also provide them.
+ 
+-# The list of system calls is current as of Linux 6.4.
+-kernel 6.4
++# The list of system calls is current as of Linux 6.5.
++kernel 6.5
+ 
+ FAST_atomic_update
+ FAST_cmpxchg
+@@ -58,6 +58,7 @@ breakpoint
+ brk
+ cachectl
+ cacheflush
++cachestat
+ capget
+ capset
+ chdir
+diff --git a/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h b/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h
+index b4ab892ec1..58646cf0bd 100644
+--- a/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h
+@@ -12,6 +12,7 @@
+ #define __NR_bind 49
+ #define __NR_bpf 321
+ #define __NR_brk 12
++#define __NR_cachestat 451
+ #define __NR_capget 125
+ #define __NR_capset 126
+ #define __NR_chdir 80
+diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h b/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
+index 772559c87b..604bcdfa5b 100644
+--- a/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
+@@ -11,6 +11,7 @@
+ #define __NR_bind 1073741873
+ #define __NR_bpf 1073742145
+ #define __NR_brk 1073741836
++#define __NR_cachestat 1073742275
+ #define __NR_capget 1073741949
+ #define __NR_capset 1073741950
+ #define __NR_chdir 1073741904
diff --git a/SOURCES/glibc-RHEL-16016-7.patch b/SOURCES/glibc-RHEL-16016-7.patch
new file mode 100644
index 0000000..0257087
--- /dev/null
+++ b/SOURCES/glibc-RHEL-16016-7.patch
@@ -0,0 +1,350 @@
+commit 582383b37d95b133c1ee6855ffaa2b1f5cb3d3b8
+Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date:   Tue Oct 31 13:32:33 2023 -0300
+
+    Update syscall lists for Linux 6.6
+    
+    Linux 6.6 has one new syscall for all architectures, fchmodat2, and
+    the map_shadow_stack on x86_64.
+
+    Conflicts: Removed loongarch, or1k
+
+diff --git a/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h b/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h
+index 8f21ee66a0..746991aa2f 100644
+--- a/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h
+@@ -44,6 +44,7 @@
+ #define __NR_fchdir 50
+ #define __NR_fchmod 52
+ #define __NR_fchmodat 53
++#define __NR_fchmodat2 452
+ #define __NR_fchown 55
+ #define __NR_fchownat 54
+ #define __NR_fcntl 25
+diff --git a/sysdeps/unix/sysv/linux/alpha/arch-syscall.h b/sysdeps/unix/sysv/linux/alpha/arch-syscall.h
+index c5802a5fec..32efe51267 100644
+--- a/sysdeps/unix/sysv/linux/alpha/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/alpha/arch-syscall.h
+@@ -56,6 +56,7 @@
+ #define __NR_fchdir 13
+ #define __NR_fchmod 124
+ #define __NR_fchmodat 461
++#define __NR_fchmodat2 562
+ #define __NR_fchown 123
+ #define __NR_fchownat 453
+ #define __NR_fcntl 92
+diff --git a/sysdeps/unix/sysv/linux/arc/arch-syscall.h b/sysdeps/unix/sysv/linux/arc/arch-syscall.h
+index f23f9e1154..1d2879e877 100644
+--- a/sysdeps/unix/sysv/linux/arc/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/arc/arch-syscall.h
+@@ -48,6 +48,7 @@
+ #define __NR_fchdir 50
+ #define __NR_fchmod 52
+ #define __NR_fchmodat 53
++#define __NR_fchmodat2 452
+ #define __NR_fchown 55
+ #define __NR_fchownat 54
+ #define __NR_fcntl64 25
+diff --git a/sysdeps/unix/sysv/linux/arm/arch-syscall.h b/sysdeps/unix/sysv/linux/arm/arch-syscall.h
+index 7edf574899..6711981e78 100644
+--- a/sysdeps/unix/sysv/linux/arm/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/arm/arch-syscall.h
+@@ -64,6 +64,7 @@
+ #define __NR_fchdir 133
+ #define __NR_fchmod 94
+ #define __NR_fchmodat 333
++#define __NR_fchmodat2 452
+ #define __NR_fchown 95
+ #define __NR_fchown32 207
+ #define __NR_fchownat 325
+diff --git a/sysdeps/unix/sysv/linux/csky/arch-syscall.h b/sysdeps/unix/sysv/linux/csky/arch-syscall.h
+index d74a06e063..92d9a703ea 100644
+--- a/sysdeps/unix/sysv/linux/csky/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/csky/arch-syscall.h
+@@ -50,6 +50,7 @@
+ #define __NR_fchdir 50
+ #define __NR_fchmod 52
+ #define __NR_fchmodat 53
++#define __NR_fchmodat2 452
+ #define __NR_fchown 55
+ #define __NR_fchownat 54
+ #define __NR_fcntl64 25
+diff --git a/sysdeps/unix/sysv/linux/hppa/arch-syscall.h b/sysdeps/unix/sysv/linux/hppa/arch-syscall.h
+index 5568b94cd3..fbac124b70 100644
+--- a/sysdeps/unix/sysv/linux/hppa/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/hppa/arch-syscall.h
+@@ -63,6 +63,7 @@
+ #define __NR_fchdir 133
+ #define __NR_fchmod 94
+ #define __NR_fchmodat 286
++#define __NR_fchmodat2 452
+ #define __NR_fchown 95
+ #define __NR_fchownat 278
+ #define __NR_fcntl 55
+diff --git a/sysdeps/unix/sysv/linux/i386/arch-syscall.h b/sysdeps/unix/sysv/linux/i386/arch-syscall.h
+index 3af21a15cb..8961788a96 100644
+--- a/sysdeps/unix/sysv/linux/i386/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/i386/arch-syscall.h
+@@ -67,6 +67,7 @@
+ #define __NR_fchdir 133
+ #define __NR_fchmod 94
+ #define __NR_fchmodat 306
++#define __NR_fchmodat2 452
+ #define __NR_fchown 95
+ #define __NR_fchown32 207
+ #define __NR_fchownat 298
+diff --git a/sysdeps/unix/sysv/linux/ia64/arch-syscall.h b/sysdeps/unix/sysv/linux/ia64/arch-syscall.h
+index 39b270e642..1ef762d693 100644
+--- a/sysdeps/unix/sysv/linux/ia64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/ia64/arch-syscall.h
+@@ -55,6 +55,7 @@
+ #define __NR_fchdir 1035
+ #define __NR_fchmod 1099
+ #define __NR_fchmodat 1292
++#define __NR_fchmodat2 1476
+ #define __NR_fchown 1100
+ #define __NR_fchownat 1284
+ #define __NR_fcntl 1066
+diff --git a/sysdeps/unix/sysv/linux/m68k/arch-syscall.h b/sysdeps/unix/sysv/linux/m68k/arch-syscall.h
+index 315e49cd33..2053d5d392 100644
+--- a/sysdeps/unix/sysv/linux/m68k/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/m68k/arch-syscall.h
+@@ -67,6 +67,7 @@
+ #define __NR_fchdir 133
+ #define __NR_fchmod 94
+ #define __NR_fchmodat 299
++#define __NR_fchmodat2 452
+ #define __NR_fchown 95
+ #define __NR_fchown32 207
+ #define __NR_fchownat 291
+diff --git a/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h b/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h
+index 54af12780c..6865b1693c 100644
+--- a/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h
+@@ -67,6 +67,7 @@
+ #define __NR_fchdir 133
+ #define __NR_fchmod 94
+ #define __NR_fchmodat 306
++#define __NR_fchmodat2 452
+ #define __NR_fchown 95
+ #define __NR_fchown32 207
+ #define __NR_fchownat 298
+diff --git a/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h b/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h
+index a2aa1ffa1b..b13ace8e1c 100644
+--- a/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h
+@@ -67,6 +67,7 @@
+ #define __NR_fchdir 4133
+ #define __NR_fchmod 4094
+ #define __NR_fchmodat 4299
++#define __NR_fchmodat2 4452
+ #define __NR_fchown 4095
+ #define __NR_fchownat 4291
+ #define __NR_fcntl 4055
+diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h
+index 5bec858040..b7a7c0dfa7 100644
+--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h
+@@ -64,6 +64,7 @@
+ #define __NR_fchdir 6079
+ #define __NR_fchmod 6089
+ #define __NR_fchmodat 6262
++#define __NR_fchmodat2 6452
+ #define __NR_fchown 6091
+ #define __NR_fchownat 6254
+ #define __NR_fcntl 6070
+diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h
+index 0166371ee2..e5d7f91f48 100644
+--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h
+@@ -59,6 +59,7 @@
+ #define __NR_fchdir 5079
+ #define __NR_fchmod 5089
+ #define __NR_fchmodat 5258
++#define __NR_fchmodat2 5452
+ #define __NR_fchown 5091
+ #define __NR_fchownat 5250
+ #define __NR_fcntl 5070
+diff --git a/sysdeps/unix/sysv/linux/nios2/arch-syscall.h b/sysdeps/unix/sysv/linux/nios2/arch-syscall.h
+index 29a4cfa988..89950cc33a 100644
+--- a/sysdeps/unix/sysv/linux/nios2/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/nios2/arch-syscall.h
+@@ -49,6 +49,7 @@
+ #define __NR_fchdir 50
+ #define __NR_fchmod 52
+ #define __NR_fchmodat 53
++#define __NR_fchmodat2 452
+ #define __NR_fchown 55
+ #define __NR_fchownat 54
+ #define __NR_fcntl64 25
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h
+index 3a212a0269..64683bcb76 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h
+@@ -66,6 +66,7 @@
+ #define __NR_fchdir 133
+ #define __NR_fchmod 94
+ #define __NR_fchmodat 297
++#define __NR_fchmodat2 452
+ #define __NR_fchown 95
+ #define __NR_fchownat 289
+ #define __NR_fcntl 55
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h
+index 1038ead227..af1bbf32e8 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h
+@@ -60,6 +60,7 @@
+ #define __NR_fchdir 133
+ #define __NR_fchmod 94
+ #define __NR_fchmodat 297
++#define __NR_fchmodat2 452
+ #define __NR_fchown 95
+ #define __NR_fchownat 289
+ #define __NR_fcntl 55
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+index 57b043ffb5..56e3088cbf 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h
+@@ -43,6 +43,7 @@
+ #define __NR_fchdir 50
+ #define __NR_fchmod 52
+ #define __NR_fchmodat 53
++#define __NR_fchmodat2 452
+ #define __NR_fchown 55
+ #define __NR_fchownat 54
+ #define __NR_fcntl64 25
+diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+index 1041a0f8c9..508161b47a 100644
+--- a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
+@@ -44,6 +44,7 @@
+ #define __NR_fchdir 50
+ #define __NR_fchmod 52
+ #define __NR_fchmodat 53
++#define __NR_fchmodat2 452
+ #define __NR_fchown 55
+ #define __NR_fchownat 54
+ #define __NR_fcntl 25
+diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h b/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h
+index 70d4c6782e..1498ebf42e 100644
+--- a/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h
+@@ -65,6 +65,7 @@
+ #define __NR_fchdir 133
+ #define __NR_fchmod 94
+ #define __NR_fchmodat 299
++#define __NR_fchmodat2 452
+ #define __NR_fchown 95
+ #define __NR_fchown32 207
+ #define __NR_fchownat 291
+diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h b/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h
+index 65a8a9e316..624d71b56d 100644
+--- a/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h
+@@ -56,6 +56,7 @@
+ #define __NR_fchdir 133
+ #define __NR_fchmod 94
+ #define __NR_fchmodat 299
++#define __NR_fchmodat2 452
+ #define __NR_fchown 207
+ #define __NR_fchownat 291
+ #define __NR_fcntl 55
+diff --git a/sysdeps/unix/sysv/linux/sh/arch-syscall.h b/sysdeps/unix/sysv/linux/sh/arch-syscall.h
+index 94aad0f119..37211f5f8c 100644
+--- a/sysdeps/unix/sysv/linux/sh/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/sh/arch-syscall.h
+@@ -64,6 +64,7 @@
+ #define __NR_fchdir 133
+ #define __NR_fchmod 94
+ #define __NR_fchmodat 306
++#define __NR_fchmodat2 452
+ #define __NR_fchown 95
+ #define __NR_fchown32 207
+ #define __NR_fchownat 298
+diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h b/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h
+index d630306c75..8093abcc9c 100644
+--- a/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h
+@@ -66,6 +66,7 @@
+ #define __NR_fchdir 176
+ #define __NR_fchmod 124
+ #define __NR_fchmodat 295
++#define __NR_fchmodat2 452
+ #define __NR_fchown 123
+ #define __NR_fchown32 32
+ #define __NR_fchownat 287
+diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h b/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h
+index 930f29b4d2..d25ccfb571 100644
+--- a/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h
+@@ -60,6 +60,7 @@
+ #define __NR_fchdir 176
+ #define __NR_fchmod 124
+ #define __NR_fchmodat 295
++#define __NR_fchmodat2 452
+ #define __NR_fchown 123
+ #define __NR_fchownat 287
+ #define __NR_fcntl 92
+diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list
+index cf6f70ecd9..c3627fcd7f 100644
+--- a/sysdeps/unix/sysv/linux/syscall-names.list
++++ b/sysdeps/unix/sysv/linux/syscall-names.list
+@@ -21,8 +21,8 @@
+ # This file can list all potential system calls.  The names are only
+ # used if the installed kernel headers also provide them.
+ 
+-# The list of system calls is current as of Linux 6.5.
+-kernel 6.5
++# The list of system calls is current as of Linux 6.6.
++kernel 6.6
+ 
+ FAST_atomic_update
+ FAST_cmpxchg
+@@ -117,6 +117,7 @@ fanotify_mark
+ fchdir
+ fchmod
+ fchmodat
++fchmodat2
+ fchown
+ fchown32
+ fchownat
+@@ -246,6 +247,7 @@ lsetxattr
+ lstat
+ lstat64
+ madvise
++map_shadow_stack
+ mbind
+ membarrier
+ memfd_create
+diff --git a/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h b/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h
+index 58646cf0bd..5e4c9e901c 100644
+--- a/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h
+@@ -59,6 +59,7 @@
+ #define __NR_fchdir 81
+ #define __NR_fchmod 91
+ #define __NR_fchmodat 268
++#define __NR_fchmodat2 452
+ #define __NR_fchown 93
+ #define __NR_fchownat 260
+ #define __NR_fcntl 72
+@@ -153,6 +154,7 @@
+ #define __NR_lsetxattr 189
+ #define __NR_lstat 6
+ #define __NR_madvise 28
++#define __NR_map_shadow_stack 453
+ #define __NR_mbind 237
+ #define __NR_membarrier 324
+ #define __NR_memfd_create 319
+diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h b/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
+index 604bcdfa5b..dd5e196272 100644
+--- a/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
++++ b/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
+@@ -55,6 +55,7 @@
+ #define __NR_fchdir 1073741905
+ #define __NR_fchmod 1073741915
+ #define __NR_fchmodat 1073742092
++#define __NR_fchmodat2 1073742276
+ #define __NR_fchown 1073741917
+ #define __NR_fchownat 1073742084
+ #define __NR_fcntl 1073741896
diff --git a/SOURCES/glibc-RHEL-16275.patch b/SOURCES/glibc-RHEL-16275.patch
new file mode 100644
index 0000000..c773796
--- /dev/null
+++ b/SOURCES/glibc-RHEL-16275.patch
@@ -0,0 +1,16 @@
+Downstream-only patch to refer to /run instead of the legacy /var/run
+directory in the downstream nscd systemd socket file.
+
+diff --git a/nscd/nscd.socket b/nscd/nscd.socket
+index 7e512d5339fa1136..52a67608c7c55475 100644
+--- a/nscd/nscd.socket
++++ b/nscd/nscd.socket
+@@ -2,7 +2,7 @@
+ Description=Name Service Cache Daemon Socket
+ 
+ [Socket]
+-ListenDatagram=/var/run/nscd/socket
++ListenDatagram=/run/nscd/socket
+ 
+ [Install]
+ WantedBy=sockets.target
diff --git a/SOURCES/glibc-RHEL-16643-1.patch b/SOURCES/glibc-RHEL-16643-1.patch
new file mode 100644
index 0000000..d8d33c3
--- /dev/null
+++ b/SOURCES/glibc-RHEL-16643-1.patch
@@ -0,0 +1,211 @@
+commit 06890c7ba553e82393413c59bb3131db5815a337
+Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Date:   Tue Jul 27 22:49:53 2021 +0530
+
+    gaiconf_init: Refactor some bits for readability
+    
+    Split out line processing for `label`, `precedence` and `scopev4` into
+    separate functions instead of the gotos.
+    
+    Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+    Reviewed-by: DJ Delorie <dj@redhat.com>
+
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index d6046a707f1d742a..3bf9a8bae16a5b02 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -1858,6 +1858,66 @@ scopecmp (const void *p1, const void *p2)
+   return 1;
+ }
+ 
++static bool
++add_prefixlist (struct prefixlist **listp, size_t *lenp, bool *nullbitsp,
++		char *val1, char *val2, char **pos)
++{
++  struct in6_addr prefix;
++  unsigned long int bits;
++  unsigned long int val;
++  char *endp;
++
++  bits = 128;
++  __set_errno (0);
++  char *cp = strchr (val1, '/');
++  if (cp != NULL)
++    *cp++ = '\0';
++  *pos = cp;
++  if (inet_pton (AF_INET6, val1, &prefix)
++      && (cp == NULL
++	  || (bits = strtoul (cp, &endp, 10)) != ULONG_MAX
++	  || errno != ERANGE)
++      && *endp == '\0'
++      && bits <= 128
++      && ((val = strtoul (val2, &endp, 10)) != ULONG_MAX
++	  || errno != ERANGE)
++      && *endp == '\0'
++      && val <= INT_MAX)
++    {
++      struct prefixlist *newp = malloc (sizeof (*newp));
++      if (newp == NULL)
++	return false;
++
++      memcpy (&newp->entry.prefix, &prefix, sizeof (prefix));
++      newp->entry.bits = bits;
++      newp->entry.val = val;
++      newp->next = *listp;
++      *listp = newp;
++      ++*lenp;
++      *nullbitsp |= bits == 0;
++    }
++  return true;
++}
++
++static bool
++add_scopelist (struct scopelist **listp, size_t *lenp, bool *nullbitsp,
++	       const struct in6_addr *prefixp, unsigned long int bits,
++	       unsigned long int val)
++{
++  struct scopelist *newp = malloc (sizeof (*newp));
++  if (newp == NULL)
++    return false;
++
++  newp->entry.netmask = htonl (bits != 96 ? (0xffffffff << (128 - bits)) : 0);
++  newp->entry.addr32 = (prefixp->s6_addr32[3] & newp->entry.netmask);
++  newp->entry.scope = val;
++  newp->next = *listp;
++  *listp = newp;
++  ++*lenp;
++  *nullbitsp |= bits == 96;
++
++  return true;
++}
+ 
+ static void
+ gaiconf_init (void)
+@@ -1933,55 +1993,17 @@ gaiconf_init (void)
+ 	  /*  Ignore the rest of the line.  */
+ 	  *cp = '\0';
+ 
+-	  struct prefixlist **listp;
+-	  size_t *lenp;
+-	  bool *nullbitsp;
+ 	  switch (cmdlen)
+ 	    {
+ 	    case 5:
+ 	      if (strcmp (cmd, "label") == 0)
+ 		{
+-		  struct in6_addr prefix;
+-		  unsigned long int bits;
+-		  unsigned long int val;
+-		  char *endp;
+-
+-		  listp = &labellist;
+-		  lenp = &nlabellist;
+-		  nullbitsp = &labellist_nullbits;
+-
+-		new_elem:
+-		  bits = 128;
+-		  __set_errno (0);
+-		  cp = strchr (val1, '/');
+-		  if (cp != NULL)
+-		    *cp++ = '\0';
+-		  if (inet_pton (AF_INET6, val1, &prefix)
+-		      && (cp == NULL
+-			  || (bits = strtoul (cp, &endp, 10)) != ULONG_MAX
+-			  || errno != ERANGE)
+-		      && *endp == '\0'
+-		      && bits <= 128
+-		      && ((val = strtoul (val2, &endp, 10)) != ULONG_MAX
+-			  || errno != ERANGE)
+-		      && *endp == '\0'
+-		      && val <= INT_MAX)
++		  if (!add_prefixlist (&labellist, &nlabellist,
++				       &labellist_nullbits, val1, val2, &cp))
+ 		    {
+-		      struct prefixlist *newp = malloc (sizeof (*newp));
+-		      if (newp == NULL)
+-			{
+-			  free (line);
+-			  fclose (fp);
+-			  goto no_file;
+-			}
+-
+-		      memcpy (&newp->entry.prefix, &prefix, sizeof (prefix));
+-		      newp->entry.bits = bits;
+-		      newp->entry.val = val;
+-		      newp->next = *listp;
+-		      *listp = newp;
+-		      ++*lenp;
+-		      *nullbitsp |= bits == 0;
++		      free (line);
++		      fclose (fp);
++		      goto no_file;
+ 		    }
+ 		}
+ 	      break;
+@@ -2023,27 +2045,14 @@ gaiconf_init (void)
+ 			  && *endp == '\0'
+ 			  && val <= INT_MAX)
+ 			{
+-			  struct scopelist *newp;
+-			new_scope:
+-			  newp = malloc (sizeof (*newp));
+-			  if (newp == NULL)
++			  if (!add_scopelist (&scopelist, &nscopelist,
++					      &scopelist_nullbits, &prefix,
++					      bits, val))
+ 			    {
+ 			      free (line);
+ 			      fclose (fp);
+ 			      goto no_file;
+ 			    }
+-
+-			  newp->entry.netmask = htonl (bits != 96
+-						       ? (0xffffffff
+-							  << (128 - bits))
+-						       : 0);
+-			  newp->entry.addr32 = (prefix.s6_addr32[3]
+-						& newp->entry.netmask);
+-			  newp->entry.scope = val;
+-			  newp->next = scopelist;
+-			  scopelist = newp;
+-			  ++nscopelist;
+-			  scopelist_nullbits |= bits == 96;
+ 			}
+ 		    }
+ 		  else if (inet_pton (AF_INET, val1, &prefix.s6_addr32[3])
+@@ -2057,8 +2066,14 @@ gaiconf_init (void)
+ 			   && *endp == '\0'
+ 			   && val <= INT_MAX)
+ 		    {
+-		      bits += 96;
+-		      goto new_scope;
++		      if (!add_scopelist (&scopelist, &nscopelist,
++					  &scopelist_nullbits, &prefix,
++					  bits + 96, val))
++			{
++			  free (line);
++			  fclose (fp);
++			  goto no_file;
++			}
+ 		    }
+ 		}
+ 	      break;
+@@ -2066,10 +2081,14 @@ gaiconf_init (void)
+ 	    case 10:
+ 	      if (strcmp (cmd, "precedence") == 0)
+ 		{
+-		  listp = &precedencelist;
+-		  lenp = &nprecedencelist;
+-		  nullbitsp = &precedencelist_nullbits;
+-		  goto new_elem;
++		  if (!add_prefixlist (&precedencelist, &nprecedencelist,
++				       &precedencelist_nullbits, val1, val2,
++				       &cp))
++		    {
++		      free (line);
++		      fclose (fp);
++		      goto no_file;
++		    }
+ 		}
+ 	      break;
+ 	    }
diff --git a/SOURCES/glibc-RHEL-16643-2.patch b/SOURCES/glibc-RHEL-16643-2.patch
new file mode 100644
index 0000000..ed0a98c
--- /dev/null
+++ b/SOURCES/glibc-RHEL-16643-2.patch
@@ -0,0 +1,584 @@
+commit bc0d18d873abf2cda6842ad8bb4df2a31dc0fbac
+Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Date:   Tue Aug 3 21:29:23 2021 +0530
+
+    gai_init: Avoid jumping from if condition to its else counterpart
+    
+    Clean up another antipattern where code flows from an if condition to
+    its else counterpart with a goto.
+    
+    Most of the change in this patch is whitespace-only; a `git diff -b`
+    ought to show the actual logic changes.
+    
+    Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+    Reviewed-by: DJ Delorie <dj@redhat.com>
+
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index 3bf9a8bae16a5b02..1635a09837351068 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -1933,142 +1933,122 @@ gaiconf_init (void)
+   bool scopelist_nullbits = false;
+ 
+   FILE *fp = fopen (GAICONF_FNAME, "rce");
+-  if (fp != NULL)
++  if (fp == NULL)
++    goto no_file;
++
++  struct __stat64_t64 st;
++  if (__fstat64_time64 (fileno (fp), &st) != 0)
+     {
+-      struct __stat64_t64 st;
+-      if (__fstat64_time64 (fileno (fp), &st) != 0)
+-	{
+-	  fclose (fp);
+-	  goto no_file;
+-	}
++      fclose (fp);
++      goto no_file;
++    }
+ 
+-      char *line = NULL;
+-      size_t linelen = 0;
++  char *line = NULL;
++  size_t linelen = 0;
+ 
+-      __fsetlocking (fp, FSETLOCKING_BYCALLER);
++  __fsetlocking (fp, FSETLOCKING_BYCALLER);
+ 
+-      while (!feof_unlocked (fp))
+-	{
+-	  ssize_t n = __getline (&line, &linelen, fp);
+-	  if (n <= 0)
+-	    break;
++  while (!feof_unlocked (fp))
++    {
++      ssize_t n = __getline (&line, &linelen, fp);
++      if (n <= 0)
++	break;
+ 
+-	  /* Handle comments.  No escaping possible so this is easy.  */
+-	  char *cp = strchr (line, '#');
+-	  if (cp != NULL)
+-	    *cp = '\0';
++      /* Handle comments.  No escaping possible so this is easy.  */
++      char *cp = strchr (line, '#');
++      if (cp != NULL)
++	*cp = '\0';
+ 
+-	  cp = line;
+-	  while (isspace (*cp))
+-	    ++cp;
++      cp = line;
++      while (isspace (*cp))
++	++cp;
+ 
+-	  char *cmd = cp;
+-	  while (*cp != '\0' && !isspace (*cp))
+-	    ++cp;
+-	  size_t cmdlen = cp - cmd;
++      char *cmd = cp;
++      while (*cp != '\0' && !isspace (*cp))
++	++cp;
++      size_t cmdlen = cp - cmd;
+ 
+-	  if (*cp != '\0')
+-	    *cp++ = '\0';
+-	  while (isspace (*cp))
+-	    ++cp;
++      if (*cp != '\0')
++	*cp++ = '\0';
++      while (isspace (*cp))
++	++cp;
+ 
+-	  char *val1 = cp;
+-	  while (*cp != '\0' && !isspace (*cp))
+-	    ++cp;
+-	  size_t val1len = cp - cmd;
++      char *val1 = cp;
++      while (*cp != '\0' && !isspace (*cp))
++	++cp;
++      size_t val1len = cp - cmd;
+ 
+-	  /* We always need at least two values.  */
+-	  if (val1len == 0)
+-	    continue;
++      /* We always need at least two values.  */
++      if (val1len == 0)
++	continue;
+ 
+-	  if (*cp != '\0')
+-	    *cp++ = '\0';
+-	  while (isspace (*cp))
+-	    ++cp;
++      if (*cp != '\0')
++	*cp++ = '\0';
++      while (isspace (*cp))
++	++cp;
+ 
+-	  char *val2 = cp;
+-	  while (*cp != '\0' && !isspace (*cp))
+-	    ++cp;
++      char *val2 = cp;
++      while (*cp != '\0' && !isspace (*cp))
++	++cp;
+ 
+-	  /*  Ignore the rest of the line.  */
+-	  *cp = '\0';
++      /*  Ignore the rest of the line.  */
++      *cp = '\0';
+ 
+-	  switch (cmdlen)
++      switch (cmdlen)
++	{
++	case 5:
++	  if (strcmp (cmd, "label") == 0)
+ 	    {
+-	    case 5:
+-	      if (strcmp (cmd, "label") == 0)
++	      if (!add_prefixlist (&labellist, &nlabellist,
++				   &labellist_nullbits, val1, val2, &cp))
+ 		{
+-		  if (!add_prefixlist (&labellist, &nlabellist,
+-				       &labellist_nullbits, val1, val2, &cp))
+-		    {
+-		      free (line);
+-		      fclose (fp);
+-		      goto no_file;
+-		    }
++		  free (line);
++		  fclose (fp);
++		  goto no_file;
+ 		}
+-	      break;
++	    }
++	  break;
+ 
+-	    case 6:
+-	      if (strcmp (cmd, "reload") == 0)
+-		{
+-		  gaiconf_reload_flag = strcmp (val1, "yes") == 0;
+-		  if (gaiconf_reload_flag)
+-		    gaiconf_reload_flag_ever_set = 1;
+-		}
+-	      break;
++	case 6:
++	  if (strcmp (cmd, "reload") == 0)
++	    {
++	      gaiconf_reload_flag = strcmp (val1, "yes") == 0;
++	      if (gaiconf_reload_flag)
++		gaiconf_reload_flag_ever_set = 1;
++	    }
++	  break;
+ 
+-	    case 7:
+-	      if (strcmp (cmd, "scopev4") == 0)
++	case 7:
++	  if (strcmp (cmd, "scopev4") == 0)
++	    {
++	      struct in6_addr prefix;
++	      unsigned long int bits;
++	      unsigned long int val;
++	      char *endp;
++
++	      bits = 32;
++	      __set_errno (0);
++	      cp = strchr (val1, '/');
++	      if (cp != NULL)
++		*cp++ = '\0';
++	      if (inet_pton (AF_INET6, val1, &prefix))
+ 		{
+-		  struct in6_addr prefix;
+-		  unsigned long int bits;
+-		  unsigned long int val;
+-		  char *endp;
+-
+-		  bits = 32;
+-		  __set_errno (0);
+-		  cp = strchr (val1, '/');
+-		  if (cp != NULL)
+-		    *cp++ = '\0';
+-		  if (inet_pton (AF_INET6, val1, &prefix))
+-		    {
+-		      bits = 128;
+-		      if (IN6_IS_ADDR_V4MAPPED (&prefix)
+-			  && (cp == NULL
+-			      || (bits = strtoul (cp, &endp, 10)) != ULONG_MAX
+-			      || errno != ERANGE)
+-			  && *endp == '\0'
+-			  && bits >= 96
+-			  && bits <= 128
+-			  && ((val = strtoul (val2, &endp, 10)) != ULONG_MAX
+-			      || errno != ERANGE)
+-			  && *endp == '\0'
+-			  && val <= INT_MAX)
+-			{
+-			  if (!add_scopelist (&scopelist, &nscopelist,
+-					      &scopelist_nullbits, &prefix,
+-					      bits, val))
+-			    {
+-			      free (line);
+-			      fclose (fp);
+-			      goto no_file;
+-			    }
+-			}
+-		    }
+-		  else if (inet_pton (AF_INET, val1, &prefix.s6_addr32[3])
+-			   && (cp == NULL
+-			       || (bits = strtoul (cp, &endp, 10)) != ULONG_MAX
+-			       || errno != ERANGE)
+-			   && *endp == '\0'
+-			   && bits <= 32
+-			   && ((val = strtoul (val2, &endp, 10)) != ULONG_MAX
+-			       || errno != ERANGE)
+-			   && *endp == '\0'
+-			   && val <= INT_MAX)
++		  bits = 128;
++		  if (IN6_IS_ADDR_V4MAPPED (&prefix)
++		      && (cp == NULL
++			  || (bits = strtoul (cp, &endp, 10)) != ULONG_MAX
++			  || errno != ERANGE)
++		      && *endp == '\0'
++		      && bits >= 96
++		      && bits <= 128
++		      && ((val = strtoul (val2, &endp, 10)) != ULONG_MAX
++			  || errno != ERANGE)
++		      && *endp == '\0'
++		      && val <= INT_MAX)
+ 		    {
+ 		      if (!add_scopelist (&scopelist, &nscopelist,
+ 					  &scopelist_nullbits, &prefix,
+-					  bits + 96, val))
++					  bits, val))
+ 			{
+ 			  free (line);
+ 			  fclose (fp);
+@@ -2076,173 +2056,191 @@ gaiconf_init (void)
+ 			}
+ 		    }
+ 		}
+-	      break;
+-
+-	    case 10:
+-	      if (strcmp (cmd, "precedence") == 0)
++	      else if (inet_pton (AF_INET, val1, &prefix.s6_addr32[3])
++		       && (cp == NULL
++			   || (bits = strtoul (cp, &endp, 10)) != ULONG_MAX
++			   || errno != ERANGE)
++		       && *endp == '\0'
++		       && bits <= 32
++		       && ((val = strtoul (val2, &endp, 10)) != ULONG_MAX
++			   || errno != ERANGE)
++		       && *endp == '\0'
++		       && val <= INT_MAX)
+ 		{
+-		  if (!add_prefixlist (&precedencelist, &nprecedencelist,
+-				       &precedencelist_nullbits, val1, val2,
+-				       &cp))
++		  if (!add_scopelist (&scopelist, &nscopelist,
++				      &scopelist_nullbits, &prefix,
++				      bits + 96, val))
+ 		    {
+ 		      free (line);
+ 		      fclose (fp);
+ 		      goto no_file;
+ 		    }
+ 		}
+-	      break;
+-	    }
+-	}
+-
+-      free (line);
+-
+-      fclose (fp);
+-
+-      /* Create the array for the labels.  */
+-      struct prefixentry *new_labels;
+-      if (nlabellist > 0)
+-	{
+-	  if (!labellist_nullbits)
+-	    ++nlabellist;
+-	  new_labels = malloc (nlabellist * sizeof (*new_labels));
+-	  if (new_labels == NULL)
+-	    goto no_file;
+-
+-	  int i = nlabellist;
+-	  if (!labellist_nullbits)
+-	    {
+-	      --i;
+-	      memset (&new_labels[i].prefix, '\0', sizeof (struct in6_addr));
+-	      new_labels[i].bits = 0;
+-	      new_labels[i].val = 1;
+ 	    }
++	  break;
+ 
+-	  struct prefixlist *l = labellist;
+-	  while (i-- > 0)
++	case 10:
++	  if (strcmp (cmd, "precedence") == 0)
+ 	    {
+-	      new_labels[i] = l->entry;
+-	      l = l->next;
++	      if (!add_prefixlist (&precedencelist, &nprecedencelist,
++				   &precedencelist_nullbits, val1, val2,
++				   &cp))
++		{
++		  free (line);
++		  fclose (fp);
++		  goto no_file;
++		}
+ 	    }
+-	  free_prefixlist (labellist);
+-	  labellist = NULL;
+-
+-	  /* Sort the entries so that the most specific ones are at
+-	     the beginning.  */
+-	  qsort (new_labels, nlabellist, sizeof (*new_labels), prefixcmp);
++	  break;
+ 	}
+-      else
+-	new_labels = (struct prefixentry *) default_labels;
+-
+-      struct prefixentry *new_precedence;
+-      if (nprecedencelist > 0)
+-	{
+-	  if (!precedencelist_nullbits)
+-	    ++nprecedencelist;
+-	  new_precedence = malloc (nprecedencelist * sizeof (*new_precedence));
+-	  if (new_precedence == NULL)
+-	    {
+-	      if (new_labels != default_labels)
+-		free (new_labels);
+-	      goto no_file;
+-	    }
++    }
+ 
+-	  int i = nprecedencelist;
+-	  if (!precedencelist_nullbits)
+-	    {
+-	      --i;
+-	      memset (&new_precedence[i].prefix, '\0',
+-		      sizeof (struct in6_addr));
+-	      new_precedence[i].bits = 0;
+-	      new_precedence[i].val = 40;
+-	    }
++  free (line);
+ 
+-	  struct prefixlist *l = precedencelist;
+-	  while (i-- > 0)
+-	    {
+-	      new_precedence[i] = l->entry;
+-	      l = l->next;
+-	    }
+-	  free_prefixlist (precedencelist);
+-	  precedencelist = NULL;
++  fclose (fp);
+ 
+-	  /* Sort the entries so that the most specific ones are at
+-	     the beginning.  */
+-	  qsort (new_precedence, nprecedencelist, sizeof (*new_precedence),
+-		 prefixcmp);
++  /* Create the array for the labels.  */
++  struct prefixentry *new_labels;
++  if (nlabellist > 0)
++    {
++      if (!labellist_nullbits)
++	++nlabellist;
++      new_labels = malloc (nlabellist * sizeof (*new_labels));
++      if (new_labels == NULL)
++	goto no_file;
++
++      int i = nlabellist;
++      if (!labellist_nullbits)
++	{
++	  --i;
++	  memset (&new_labels[i].prefix, '\0', sizeof (struct in6_addr));
++	  new_labels[i].bits = 0;
++	  new_labels[i].val = 1;
+ 	}
+-      else
+-	new_precedence = (struct prefixentry *) default_precedence;
+ 
+-      struct scopeentry *new_scopes;
+-      if (nscopelist > 0)
++      struct prefixlist *l = labellist;
++      while (i-- > 0)
+ 	{
+-	  if (!scopelist_nullbits)
+-	    ++nscopelist;
+-	  new_scopes = malloc (nscopelist * sizeof (*new_scopes));
+-	  if (new_scopes == NULL)
+-	    {
+-	      if (new_labels != default_labels)
+-		free (new_labels);
+-	      if (new_precedence != default_precedence)
+-		free (new_precedence);
+-	      goto no_file;
+-	    }
+-
+-	  int i = nscopelist;
+-	  if (!scopelist_nullbits)
+-	    {
+-	      --i;
+-	      new_scopes[i].addr32 = 0;
+-	      new_scopes[i].netmask = 0;
+-	      new_scopes[i].scope = 14;
+-	    }
++	  new_labels[i] = l->entry;
++	  l = l->next;
++	}
++      free_prefixlist (labellist);
++      labellist = NULL;
+ 
+-	  struct scopelist *l = scopelist;
+-	  while (i-- > 0)
+-	    {
+-	      new_scopes[i] = l->entry;
+-	      l = l->next;
+-	    }
+-	  free_scopelist (scopelist);
++      /* Sort the entries so that the most specific ones are at
++	 the beginning.  */
++      qsort (new_labels, nlabellist, sizeof (*new_labels), prefixcmp);
++    }
++  else
++    new_labels = (struct prefixentry *) default_labels;
+ 
+-	  /* Sort the entries so that the most specific ones are at
+-	     the beginning.  */
+-	  qsort (new_scopes, nscopelist, sizeof (*new_scopes),
+-		 scopecmp);
++  struct prefixentry *new_precedence;
++  if (nprecedencelist > 0)
++    {
++      if (!precedencelist_nullbits)
++	++nprecedencelist;
++      new_precedence = malloc (nprecedencelist * sizeof (*new_precedence));
++      if (new_precedence == NULL)
++	{
++	  if (new_labels != default_labels)
++	    free (new_labels);
++	  goto no_file;
+ 	}
+-      else
+-	new_scopes = (struct scopeentry *) default_scopes;
+-
+-      /* Now we are ready to replace the values.  */
+-      const struct prefixentry *old = labels;
+-      labels = new_labels;
+-      if (old != default_labels)
+-	free ((void *) old);
+ 
+-      old = precedence;
+-      precedence = new_precedence;
+-      if (old != default_precedence)
+-	free ((void *) old);
++      int i = nprecedencelist;
++      if (!precedencelist_nullbits)
++	{
++	  --i;
++	  memset (&new_precedence[i].prefix, '\0',
++		  sizeof (struct in6_addr));
++	  new_precedence[i].bits = 0;
++	  new_precedence[i].val = 40;
++	}
+ 
+-      const struct scopeentry *oldscope = scopes;
+-      scopes = new_scopes;
+-      if (oldscope != default_scopes)
+-	free ((void *) oldscope);
++      struct prefixlist *l = precedencelist;
++      while (i-- > 0)
++	{
++	  new_precedence[i] = l->entry;
++	  l = l->next;
++	}
++      free_prefixlist (precedencelist);
++      precedencelist = NULL;
+ 
+-      save_gaiconf_mtime (&st);
++      /* Sort the entries so that the most specific ones are at
++	 the beginning.  */
++      qsort (new_precedence, nprecedencelist, sizeof (*new_precedence),
++	     prefixcmp);
+     }
+   else
++    new_precedence = (struct prefixentry *) default_precedence;
++
++  struct scopeentry *new_scopes;
++  if (nscopelist > 0)
+     {
+-    no_file:
+-      free_prefixlist (labellist);
+-      free_prefixlist (precedencelist);
++      if (!scopelist_nullbits)
++	++nscopelist;
++      new_scopes = malloc (nscopelist * sizeof (*new_scopes));
++      if (new_scopes == NULL)
++	{
++	  if (new_labels != default_labels)
++	    free (new_labels);
++	  if (new_precedence != default_precedence)
++	    free (new_precedence);
++	  goto no_file;
++	}
++
++      int i = nscopelist;
++      if (!scopelist_nullbits)
++	{
++	  --i;
++	  new_scopes[i].addr32 = 0;
++	  new_scopes[i].netmask = 0;
++	  new_scopes[i].scope = 14;
++	}
++
++      struct scopelist *l = scopelist;
++      while (i-- > 0)
++	{
++	  new_scopes[i] = l->entry;
++	  l = l->next;
++	}
+       free_scopelist (scopelist);
+ 
+-      /* If we previously read the file but it is gone now, free the
+-	 old data and use the builtin one.  Leave the reload flag
+-	 alone.  */
+-      fini ();
++      /* Sort the entries so that the most specific ones are at
++	 the beginning.  */
++      qsort (new_scopes, nscopelist, sizeof (*new_scopes),
++	     scopecmp);
+     }
++  else
++    new_scopes = (struct scopeentry *) default_scopes;
++
++  /* Now we are ready to replace the values.  */
++  const struct prefixentry *old = labels;
++  labels = new_labels;
++  if (old != default_labels)
++    free ((void *) old);
++
++  old = precedence;
++  precedence = new_precedence;
++  if (old != default_precedence)
++    free ((void *) old);
++
++  const struct scopeentry *oldscope = scopes;
++  scopes = new_scopes;
++  if (oldscope != default_scopes)
++    free ((void *) oldscope);
++
++  save_gaiconf_mtime (&st);
++  return;
++
++no_file:
++  free_prefixlist (labellist);
++  free_prefixlist (precedencelist);
++  free_scopelist (scopelist);
++
++  /* If we previously read the file but it is gone now, free the old data and
++     use the builtin one.  Leave the reload flag alone.  */
++  fini ();
+ }
+ 
+ 
diff --git a/SOURCES/glibc-RHEL-16643-3.patch b/SOURCES/glibc-RHEL-16643-3.patch
new file mode 100644
index 0000000..c9f092a
--- /dev/null
+++ b/SOURCES/glibc-RHEL-16643-3.patch
@@ -0,0 +1,90 @@
+commit d3f2c2c8b57bdf9d963db8fa2372d6c1b86a337e
+Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Date:   Tue Mar 22 22:40:05 2022 +0530
+
+    getaddrinfo: Refactor code for readability
+    
+    The close_retry goto jump is confusing and clumsy to read, so refactor
+    the code a bit to make it easier to follow.
+    
+    Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+    Reviewed-by: DJ Delorie <dj@redhat.com>
+
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index 1635a09837351068..5e9bd17eb949974c 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -2253,6 +2253,36 @@ gaiconf_reload (void)
+     gaiconf_init ();
+ }
+ 
++static bool
++try_connect (int *fdp, int *afp, struct sockaddr_in6 *source_addrp,
++	     const struct sockaddr *addr, socklen_t addrlen, int family)
++{
++  int fd = *fdp;
++  int af = *afp;
++  socklen_t sl = sizeof (*source_addrp);
++
++  while (true)
++    {
++      if (fd != -1 && __connect (fd, addr, addrlen) == 0
++	  && __getsockname (fd, (struct sockaddr *) source_addrp, &sl) == 0)
++	return true;
++
++      if (errno == EAFNOSUPPORT && af == AF_INET6 && family == AF_INET)
++	{
++	  /* This could mean IPv6 sockets are IPv6-only.  */
++	  if (fd != -1)
++	    __close_nocancel_nostatus (fd);
++	  *afp = af = AF_INET;
++	  *fdp = fd = __socket (AF_INET, SOCK_DGRAM | SOCK_CLOEXEC,
++				IPPROTO_IP);
++	  continue;
++	}
++
++      return false;
++    }
++
++  __builtin_unreachable ();
++}
+ 
+ int
+ getaddrinfo (const char *name, const char *service,
+@@ -2443,7 +2473,6 @@ getaddrinfo (const char *name, const char *service,
+ 	      if (fd == -1 || (af == AF_INET && q->ai_family == AF_INET6))
+ 		{
+ 		  if (fd != -1)
+-		  close_retry:
+ 		    __close_nocancel_nostatus (fd);
+ 		  af = q->ai_family;
+ 		  fd = __socket (af, SOCK_DGRAM | SOCK_CLOEXEC, IPPROTO_IP);
+@@ -2455,14 +2484,10 @@ getaddrinfo (const char *name, const char *service,
+ 		  __connect (fd, &sa, sizeof (sa));
+ 		}
+ 
+-	      socklen_t sl = sizeof (results[i].source_addr);
+-	      if (fd != -1
+-		  && __connect (fd, q->ai_addr, q->ai_addrlen) == 0
+-		  && __getsockname (fd,
+-				    (struct sockaddr *) &results[i].source_addr,
+-				    &sl) == 0)
++	      if (try_connect (&fd, &af, &results[i].source_addr, q->ai_addr,
++			       q->ai_addrlen, q->ai_family))
+ 		{
+-		  results[i].source_addr_len = sl;
++		  results[i].source_addr_len = sizeof (results[i].source_addr);
+ 		  results[i].got_source_addr = true;
+ 
+ 		  if (in6ai != NULL)
+@@ -2527,10 +2552,6 @@ getaddrinfo (const char *name, const char *service,
+ 		      results[i].source_addr_len = sizeof (struct sockaddr_in);
+ 		    }
+ 		}
+-	      else if (errno == EAFNOSUPPORT && af == AF_INET6
+-		       && q->ai_family == AF_INET)
+-		/* This could mean IPv6 sockets are IPv6-only.  */
+-		goto close_retry;
+ 	      else
+ 		/* Just make sure that if we have to process the same
+ 		   address again we do not copy any memory.  */
diff --git a/SOURCES/glibc-RHEL-16643-4.patch b/SOURCES/glibc-RHEL-16643-4.patch
new file mode 100644
index 0000000..53429e7
--- /dev/null
+++ b/SOURCES/glibc-RHEL-16643-4.patch
@@ -0,0 +1,32 @@
+commit c9226c03da0276593a0918eaa9a14835183343e8
+Author: Jörg Sonnenberger <joerg@bec.de>
+Date:   Mon Sep 26 13:59:16 2022 -0400
+
+    get_nscd_addresses: Fix subscript typos [BZ #29605]
+    
+    Fix the subscript on air->family, which was accidentally set to COUNT
+    when it should have remained as I.
+    
+    Resolves: BZ #29605
+    
+    Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index 5e9bd17eb949974c..40a32a3de30cb294 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -549,11 +549,11 @@ get_nscd_addresses (const char *name, const struct addrinfo *req,
+ 	  at[count].addr[2] = htonl (0xffff);
+ 	}
+       else if (req->ai_family == AF_UNSPEC
+-	       || air->family[count] == req->ai_family)
++	       || air->family[i] == req->ai_family)
+ 	{
+-	  at[count].family = air->family[count];
++	  at[count].family = air->family[i];
+ 	  memcpy (at[count].addr, addrs, size);
+-	  if (air->family[count] == AF_INET6)
++	  if (air->family[i] == AF_INET6)
+ 	    res->got_ipv6 = true;
+ 	}
+       at[count].next = at + count + 1;
diff --git a/SOURCES/glibc-RHEL-16643-5.patch b/SOURCES/glibc-RHEL-16643-5.patch
new file mode 100644
index 0000000..8b16670
--- /dev/null
+++ b/SOURCES/glibc-RHEL-16643-5.patch
@@ -0,0 +1,25 @@
+commit 3bf7bab88b0da01d4f5ef20afbbb45203185501e
+Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Date:   Tue Sep 5 17:04:05 2023 -0400
+
+    getcanonname: Fix a typo
+    
+    This code is generally unused in practice since there don't seem to be
+    any NSS modules that only implement _nss_MOD_gethostbyname2_r and not
+    _nss_MOD_gethostbyname3_r.
+    
+    Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index 40a32a3de30cb294..e9f47aea358a3351 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -346,7 +346,7 @@ getcanonname (nss_action_list nip, const char *hname, const char *name)
+ 	   string.  */
+ 	s = (char *) name;
+     }
+-  return __strdup (name);
++  return __strdup (s);
+ }
+ 
+ /* Process looked up canonical name and if necessary, decode to IDNA.  Result
diff --git a/SOURCES/glibc-RHEL-16643-6.patch b/SOURCES/glibc-RHEL-16643-6.patch
new file mode 100644
index 0000000..dd72b79
--- /dev/null
+++ b/SOURCES/glibc-RHEL-16643-6.patch
@@ -0,0 +1,23 @@
+commit 61bac1a9d2ab80ebcbc51484722e6ea43414bec7
+Author: Florian Weimer <fweimer@redhat.com>
+Date:   Wed Dec 20 16:14:33 2023 +0100
+
+    nss: Remove unused allocation from get_nscd_addresses in getaddrinfo
+    
+    No bug because this is not visible if glibc is built with
+    optimization.  Otherwise this would be a critical resource leak.
+    
+    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index e9f47aea358a3351..321a6679d46494a3 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -514,7 +514,6 @@ get_nscd_addresses (const char *name, const struct addrinfo *req,
+   int result = 0;
+   char *addrs = air->addrs;
+ 
+-  struct gaih_addrtuple *addrfree = calloc (air->naddrs, sizeof (*addrfree));
+   struct gaih_addrtuple *at = calloc (air->naddrs, sizeof (*at));
+   if (at == NULL)
+     {
diff --git a/SOURCES/glibc-RHEL-17319-1.patch b/SOURCES/glibc-RHEL-17319-1.patch
new file mode 100644
index 0000000..513c4e0
--- /dev/null
+++ b/SOURCES/glibc-RHEL-17319-1.patch
@@ -0,0 +1,35 @@
+commit b893410be304ddcea0bd43f537a13e8b18d37cf2
+Author: Florian Weimer <fweimer@redhat.com>
+Date:   Mon Nov 27 11:28:07 2023 +0100
+
+    elf: In _dl_relocate_object, skip processing if object is relocated
+    
+    This is just a minor optimization.  It also makes it more obvious that
+    _dl_relocate_object can be called multiple times.
+    
+    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+
+diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
+index be3e09e36835ed23..0254e589c06fbf4c 100644
+--- a/elf/dl-reloc.c
++++ b/elf/dl-reloc.c
+@@ -192,6 +192,9 @@ void
+ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
+ 		     int reloc_mode, int consider_profiling)
+ {
++  if (l->l_relocated)
++    return;
++
+   struct textrels
+   {
+     caddr_t start;
+@@ -229,9 +232,6 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
+ # define consider_symbind 0
+ #endif
+ 
+-  if (l->l_relocated)
+-    return;
+-
+   /* If DT_BIND_NOW is set relocate all references in this object.  We
+      do not do this if we are profiling, of course.  */
+   // XXX Correct for auditing?
diff --git a/SOURCES/glibc-RHEL-17319-2.patch b/SOURCES/glibc-RHEL-17319-2.patch
new file mode 100644
index 0000000..e93db42
--- /dev/null
+++ b/SOURCES/glibc-RHEL-17319-2.patch
@@ -0,0 +1,121 @@
+commit a74c2e1cbc8673dd7e97aae2f2705392e2ccc3f6
+Author: Florian Weimer <fweimer@redhat.com>
+Date:   Mon Nov 27 11:28:10 2023 +0100
+
+    elf: Introduce the _dl_open_relocate_one_object function
+    
+    It is extracted from dl_open_worker_begin.
+    
+    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index c8a5d88161441031..cf3baccccb461878 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -467,6 +467,50 @@ activate_nodelete (struct link_map *new)
+       }
+ }
+ 
++/* Relocate the object L.  *RELOCATION_IN_PROGRESS controls whether
++   the debugger is notified of the start of relocation processing.  */
++static void
++_dl_open_relocate_one_object (struct dl_open_args *args, struct r_debug *r,
++			      struct link_map *l, int reloc_mode,
++			      bool *relocation_in_progress)
++{
++  if (l->l_real->l_relocated)
++    return;
++
++  if (!*relocation_in_progress)
++    {
++      /* Notify the debugger that relocations are about to happen.  */
++      LIBC_PROBE (reloc_start, 2, args->nsid, r);
++      *relocation_in_progress = true;
++    }
++
++#ifdef SHARED
++  if (__glibc_unlikely (GLRO(dl_profile) != NULL))
++    {
++      /* If this here is the shared object which we want to profile
++	 make sure the profile is started.  We can find out whether
++	 this is necessary or not by observing the `_dl_profile_map'
++	 variable.  If it was NULL but is not NULL afterwards we must
++	 start the profiling.  */
++      struct link_map *old_profile_map = GL(dl_profile_map);
++
++      _dl_relocate_object (l, l->l_scope, reloc_mode | RTLD_LAZY, 1);
++
++      if (old_profile_map == NULL && GL(dl_profile_map) != NULL)
++	{
++	  /* We must prepare the profiling.  */
++	  _dl_start_profile ();
++
++	  /* Prevent unloading the object.  */
++	  GL(dl_profile_map)->l_nodelete_active = true;
++	}
++    }
++  else
++#endif
++    _dl_relocate_object (l, l->l_scope, reloc_mode, 0);
++}
++
++
+ /* struct dl_init_args and call_dl_init are used to call _dl_init with
+    exception handling disabled.  */
+ struct dl_init_args
+@@ -651,7 +695,7 @@ dl_open_worker_begin (void *a)
+     }
+   while (l != NULL);
+ 
+-  int relocation_in_progress = 0;
++  bool relocation_in_progress = false;
+ 
+   /* Perform relocation.  This can trigger lazy binding in IFUNC
+      resolvers.  For NODELETE mappings, these dependencies are not
+@@ -662,44 +706,8 @@ dl_open_worker_begin (void *a)
+      are undefined anyway, so this is not a problem.  */
+ 
+   for (unsigned int i = last; i-- > first; )
+-    {
+-      l = new->l_initfini[i];
+-
+-      if (l->l_real->l_relocated)
+-	continue;
+-
+-      if (! relocation_in_progress)
+-	{
+-	  /* Notify the debugger that relocations are about to happen.  */
+-	  LIBC_PROBE (reloc_start, 2, args->nsid, r);
+-	  relocation_in_progress = 1;
+-	}
+-
+-#ifdef SHARED
+-      if (__glibc_unlikely (GLRO(dl_profile) != NULL))
+-	{
+-	  /* If this here is the shared object which we want to profile
+-	     make sure the profile is started.  We can find out whether
+-	     this is necessary or not by observing the `_dl_profile_map'
+-	     variable.  If it was NULL but is not NULL afterwards we must
+-	     start the profiling.  */
+-	  struct link_map *old_profile_map = GL(dl_profile_map);
+-
+-	  _dl_relocate_object (l, l->l_scope, reloc_mode | RTLD_LAZY, 1);
+-
+-	  if (old_profile_map == NULL && GL(dl_profile_map) != NULL)
+-	    {
+-	      /* We must prepare the profiling.  */
+-	      _dl_start_profile ();
+-
+-	      /* Prevent unloading the object.  */
+-	      GL(dl_profile_map)->l_nodelete_active = true;
+-	    }
+-	}
+-      else
+-#endif
+-	_dl_relocate_object (l, l->l_scope, reloc_mode, 0);
+-    }
++    _dl_open_relocate_one_object (args, r, new->l_initfini[i], reloc_mode,
++				  &relocation_in_progress);
+ 
+   /* This only performs the memory allocations.  The actual update of
+      the scopes happens below, after failure is impossible.  */
diff --git a/SOURCES/glibc-RHEL-17319-3.patch b/SOURCES/glibc-RHEL-17319-3.patch
new file mode 100644
index 0000000..fc0eb28
--- /dev/null
+++ b/SOURCES/glibc-RHEL-17319-3.patch
@@ -0,0 +1,224 @@
+commit 78ca44da0160a0b442f0ca1f253e3360f044b2ec
+Author: Florian Weimer <fweimer@redhat.com>
+Date:   Mon Nov 27 11:28:13 2023 +0100
+
+    elf: Relocate libc.so early during startup and dlmopen (bug 31083)
+    
+    This makes it more likely that objects without dependencies can
+    use IFUNC resolvers in libc.so.
+    
+    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+
+Conflicts:
+	elf/Makefile
+	  (test backport differences)
+	elf/rtld.c
+	  (prelink support was removed upstream)
+
+diff --git a/elf/Makefile b/elf/Makefile
+index 8e1f91bcd917fd4e..7b7c6c171ce23247 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -419,6 +419,8 @@ tests += \
+   tst-nodelete2 \
+   tst-nodelete-dlclose \
+   tst-nodelete-opened \
++  tst-nodeps1 \
++  tst-nodeps2 \
+   tst-noload \
+   tst-null-argv \
+   tst-relsort1 \
+@@ -777,6 +779,8 @@ modules-names = \
+   tst-nodelete-dlclose-dso \
+   tst-nodelete-dlclose-plugin \
+   tst-nodelete-opened-lib \
++  tst-nodeps1-mod \
++  tst-nodeps2-mod \
+   tst-null-argv-lib \
+   tst-relsort1mod1 \
+   tst-relsort1mod2 \
+@@ -931,8 +935,15 @@ extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))
+ 
+ # filtmod1.so, tst-big-note-lib.so, tst-ro-dynamic-mod.so have special
+ # rules.
+-modules-names-nobuild := filtmod1 tst-big-note-lib tst-ro-dynamic-mod \
+-			 tst-audit24bmod1 tst-audit24bmod2
++modules-names-nobuild += \
++  filtmod1 \
++  tst-audit24bmod1 \
++  tst-audit24bmod2 \
++  tst-big-note-lib \
++  tst-nodeps1-mod \
++  tst-nodeps2-mod \
++  tst-ro-dynamic-mod \
++  # modules-names-nobuild
+ 
+ tests += $(tests-static)
+ 
+@@ -2684,3 +2695,18 @@ LDFLAGS-tst-dlclose-lazy-mod1.so = -Wl,-z,lazy,--no-as-needed
+ $(objpfx)tst-dlclose-lazy-mod1.so: $(objpfx)tst-dlclose-lazy-mod2.so
+ $(objpfx)tst-dlclose-lazy.out: \
+   $(objpfx)tst-dlclose-lazy-mod1.so $(objpfx)tst-dlclose-lazy-mod2.so
++
++# The object tst-nodeps1-mod.so has no explicit dependencies on libc.so.
++$(objpfx)tst-nodeps1-mod.so: $(objpfx)tst-nodeps1-mod.os
++	$(LINK.o) -nostartfiles -nostdlib -shared -o $@ $^
++tst-nodeps1.so-no-z-defs = yes
++# Link libc.so before the test module with the IFUNC resolver reference.
++LDFLAGS-tst-nodeps1 = $(common-objpfx)libc.so $(objpfx)tst-nodeps1-mod.so
++$(objpfx)tst-nodeps1: $(objpfx)tst-nodeps1-mod.so
++# Reuse the tst-nodeps1 module.  Link libc.so before the test module
++# with the IFUNC resolver reference.
++$(objpfx)tst-nodeps2-mod.so: $(common-objpfx)libc.so \
++  $(objpfx)tst-nodeps1-mod.so $(objpfx)tst-nodeps2-mod.os
++	$(LINK.o) -Wl,--no-as-needed -nostartfiles -nostdlib -shared -o $@ $^
++$(objpfx)tst-nodeps2.out: \
++  $(objpfx)tst-nodeps1-mod.so $(objpfx)tst-nodeps2-mod.so
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index cf3baccccb461878..4b58bdd668634130 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -705,6 +705,17 @@ dl_open_worker_begin (void *a)
+      them.  However, such relocation dependencies in IFUNC resolvers
+      are undefined anyway, so this is not a problem.  */
+ 
++  /* Ensure that libc is relocated first.  This helps with the
++     execution of IFUNC resolvers in libc, and matters only to newly
++     created dlmopen namespaces.  Do not do this for static dlopen
++     because libc has relocations against ld.so, which may not have
++     been relocated at this point.  */
++#ifdef SHARED
++  if (GL(dl_ns)[args->nsid].libc_map != NULL)
++    _dl_open_relocate_one_object (args, r, GL(dl_ns)[args->nsid].libc_map,
++				  reloc_mode, &relocation_in_progress);
++#endif
++
+   for (unsigned int i = last; i-- > first; )
+     _dl_open_relocate_one_object (args, r, new->l_initfini[i], reloc_mode,
+ 				  &relocation_in_progress);
+diff --git a/elf/rtld.c b/elf/rtld.c
+index 9de53ccaed420a57..a638d14e77745baa 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -2421,11 +2421,17 @@ dl_main (const ElfW(Phdr) *phdr,
+ 	 objects.  We do not re-relocate the dynamic linker itself in this
+ 	 loop because that could result in the GOT entries for functions we
+ 	 call being changed, and that would break us.  It is safe to relocate
+-	 the dynamic linker out of order because it has no copy relocs (we
+-	 know that because it is self-contained).  */
++	 the dynamic linker out of order because it has no copy relocations.
++	 Likewise for libc, which is relocated early to ensure that IFUNC
++	 resolvers in libc work.  */
+ 
+       int consider_profiling = GLRO(dl_profile) != NULL;
+ 
++      if (GL(dl_ns)[LM_ID_BASE].libc_map != NULL)
++	_dl_relocate_object (GL(dl_ns)[LM_ID_BASE].libc_map,
++			     GL(dl_ns)[LM_ID_BASE].libc_map->l_scope,
++			     GLRO(dl_lazy) ? RTLD_LAZY : 0, consider_profiling);
++
+       /* If we are profiling we also must do lazy reloaction.  */
+       GLRO(dl_lazy) |= consider_profiling;
+ 
+diff --git a/elf/tst-nodeps1-mod.c b/elf/tst-nodeps1-mod.c
+new file mode 100644
+index 0000000000000000..45c8e3c631251a89
+--- /dev/null
++++ b/elf/tst-nodeps1-mod.c
+@@ -0,0 +1,25 @@
++/* Test module with no libc.so dependency and string function references.
++   Copyright (C) 2023 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 <string.h>
++
++/* Some references to libc symbols which are likely to have IFUNC
++   resolvers.  If they do not, this module does not exercise bug 31083.  */
++void *memcpy_pointer = memcpy;
++void *memmove_pointer = memmove;
++void *memset_pointer = memset;
+diff --git a/elf/tst-nodeps1.c b/elf/tst-nodeps1.c
+new file mode 100644
+index 0000000000000000..1a8bde36cdb71446
+--- /dev/null
++++ b/elf/tst-nodeps1.c
+@@ -0,0 +1,23 @@
++/* Test initially loaded module with implicit libc.so dependency (bug 31083).
++   Copyright (C) 2023 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/>.  */
++
++/* Testing happens before main.  */
++int
++main (void)
++{
++}
+diff --git a/elf/tst-nodeps2-mod.c b/elf/tst-nodeps2-mod.c
+new file mode 100644
+index 0000000000000000..4913feee9b56e0e1
+--- /dev/null
++++ b/elf/tst-nodeps2-mod.c
+@@ -0,0 +1 @@
++/* Empty test module which depends on tst-nodeps1-mod.so.  */
+diff --git a/elf/tst-nodeps2.c b/elf/tst-nodeps2.c
+new file mode 100644
+index 0000000000000000..0bdc8eeb8cba3a99
+--- /dev/null
++++ b/elf/tst-nodeps2.c
+@@ -0,0 +1,29 @@
++/* Test dlmopen with implicit libc.so dependency (bug 31083).
++   Copyright (C) 2023 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 <support/xdlfcn.h>
++
++static int
++do_test (void)
++{
++  void *handle = xdlmopen (LM_ID_NEWLM, "tst-nodeps2-mod.so", RTLD_NOW);
++  xdlclose (handle);
++  return 0;
++}
++
++#include <support/test-driver.c>
diff --git a/SOURCES/glibc-RHEL-17319-4.patch b/SOURCES/glibc-RHEL-17319-4.patch
new file mode 100644
index 0000000..2c34cf6
--- /dev/null
+++ b/SOURCES/glibc-RHEL-17319-4.patch
@@ -0,0 +1,41 @@
+commit b3bee76c5f59498b9c189608f0a3132e2013fa1a
+Author: Florian Weimer <fweimer@redhat.com>
+Date:   Fri Dec 8 09:51:34 2023 +0100
+
+    elf: Initialize GLRO(dl_lazy) before relocating libc in dynamic startup
+    
+    GLRO(dl_lazy) is used to set the parameters for the early
+    _dl_relocate_object call, so the consider_profiling setting has to
+    be applied before the call.
+    
+    Fixes commit 78ca44da0160a0b442f0ca1f253e3360f044b2ec ("elf: Relocate
+    libc.so early during startup and dlmopen (bug 31083)").
+    
+    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+
+Conflicts:
+	elf/rtld.c
+	  (prelink was removed upstream)
+
+diff --git a/elf/rtld.c b/elf/rtld.c
+index a638d14e77745baa..d973c385b312ea16 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -2427,14 +2427,14 @@ dl_main (const ElfW(Phdr) *phdr,
+ 
+       int consider_profiling = GLRO(dl_profile) != NULL;
+ 
++      /* If we are profiling we also must do lazy reloaction.  */
++      GLRO(dl_lazy) |= consider_profiling;
++
+       if (GL(dl_ns)[LM_ID_BASE].libc_map != NULL)
+ 	_dl_relocate_object (GL(dl_ns)[LM_ID_BASE].libc_map,
+ 			     GL(dl_ns)[LM_ID_BASE].libc_map->l_scope,
+ 			     GLRO(dl_lazy) ? RTLD_LAZY : 0, consider_profiling);
+ 
+-      /* If we are profiling we also must do lazy reloaction.  */
+-      GLRO(dl_lazy) |= consider_profiling;
+-
+       RTLD_TIMING_VAR (start);
+       rtld_timer_start (&start);
+       unsigned i = main_map->l_searchlist.r_nlist;
diff --git a/SOURCES/glibc-RHEL-17465-1.patch b/SOURCES/glibc-RHEL-17465-1.patch
new file mode 100644
index 0000000..45dd3a6
--- /dev/null
+++ b/SOURCES/glibc-RHEL-17465-1.patch
@@ -0,0 +1,47 @@
+commit 3921c5b40f293c57cb326f58713c924b0662ef59
+Author: Hector Martin <marcan@marcan.st>
+Date:   Tue Nov 28 15:23:07 2023 +0900
+
+    elf: Fix TLS modid reuse generation assignment (BZ 29039)
+    
+    _dl_assign_tls_modid() assigns a slotinfo entry for a new module, but
+    does *not* do anything to the generation counter. The first time this
+    happens, the generation is zero and map_generation() returns the current
+    generation to be used during relocation processing. However, if
+    a slotinfo entry is later reused, it will already have a generation
+    assigned. If this generation has fallen behind the current global max
+    generation, then this causes an obsolete generation to be assigned
+    during relocation processing, as map_generation() returns this
+    generation if nonzero. _dl_add_to_slotinfo() eventually resets the
+    generation, but by then it is too late. This causes DTV updates to be
+    skipped, leading to NULL or broken TLS slot pointers and segfaults.
+    
+    Fix this by resetting the generation to zero in _dl_assign_tls_modid(),
+    so it behaves the same as the first time a slot is assigned.
+    _dl_add_to_slotinfo() will still assign the correct static generation
+    later during module load, but relocation processing will no longer use
+    an obsolete generation.
+    
+    Note that slotinfo entry (aka modid) reuse typically happens after a
+    dlclose and only TLS access via dynamic tlsdesc is affected. Because
+    tlsdesc is optimized to use the optional part of static TLS, dynamic
+    tlsdesc can be avoided by increasing the glibc.rtld.optional_static_tls
+    tunable to a large enough value, or by LD_PRELOAD-ing the affected
+    modules.
+    
+    Fixes bug 29039.
+    
+    Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+diff --git a/elf/dl-tls.c b/elf/dl-tls.c
+index b8ada16f1637c910..b9dc56e81a3b43db 100644
+--- a/elf/dl-tls.c
++++ b/elf/dl-tls.c
+@@ -160,6 +160,7 @@ _dl_assign_tls_modid (struct link_map *l)
+ 	      {
+ 		/* Mark the entry as used, so any dependency see it.  */
+ 		atomic_store_relaxed (&runp->slotinfo[result - disp].map, l);
++		atomic_store_relaxed (&runp->slotinfo[result - disp].gen, 0);
+ 		break;
+ 	      }
+ 
diff --git a/SOURCES/glibc-RHEL-17465-2.patch b/SOURCES/glibc-RHEL-17465-2.patch
new file mode 100644
index 0000000..e3abb0f
--- /dev/null
+++ b/SOURCES/glibc-RHEL-17465-2.patch
@@ -0,0 +1,198 @@
+commit 980450f12685326729d63ff72e93a996113bf073
+Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
+Date:   Wed Nov 29 11:31:37 2023 +0000
+
+    elf: Add TLS modid reuse test for bug 29039
+    
+    This is a minimal regression test for bug 29039 which only affects
+    targets with TLSDESC and a reproducer requires that
+    
+    1) Have modid gaps (closed modules) with old generation.
+    2) Update a DTV to a newer generation (needs a newer dlopen).
+    3) But do not update the closed gap entry in that DTV.
+    4) Reuse the modid gap for a new module (another dlopen).
+    5) Use dynamic TLSDESC in that new module with old generation (bug).
+    6) Access TLS via this TLSDESC and the now outdated DTV.
+    
+    However step (3) in practice rarely happens: during DTV update the
+    entries for closed modids are initialized to "unallocated" and then
+    dynamic TLSDESC calls __tls_get_addr independently of its generation.
+    The only exception to this is DTV setup at thread creation (gaps are
+    initialized to NULL instead of unallocated) or DTV resize where the
+    gap entries are outside the previous DTV array (again NULL instead
+    of unallocated, and this requires loading > DTV_SURPLUS modules).
+    
+    So the bug can only cause NULL (+ offset) dereference, not use after
+    free. And the easiest way to get (3) is via thread creation.
+    
+    Note that step (5) requires that the newly loaded module has larger
+    TLS than the remaining optional static TLS. And for (6) there cannot
+    be other TLS access or dlopen in the thread that updates the DTV.
+    
+    Tested on aarch64-linux-gnu.
+    
+    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+Conflicts:
+	elf/Makefile
+	(Resolve test case ordering conflict.)
+
+diff --git a/elf/Makefile b/elf/Makefile
+index 7b7c6c171ce23247..7d55e68a55b54bd6 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -447,6 +447,7 @@ tests += \
+   tst-tls5 \
+   tst-tlsalign \
+   tst-tlsalign-extern \
++  tst-tlsgap \
+   tst-tls-dlinfo \
+   tst-tls-ie \
+   tst-tls-ie-dlmopen \
+@@ -798,6 +799,9 @@ modules-names = \
+   tst-tls20mod-bad \
+   tst-tls21mod \
+   tst-tlsalign-lib \
++  tst-tlsgap-mod0 \
++  tst-tlsgap-mod1 \
++  tst-tlsgap-mod2 \
+   tst-tls-ie-mod0 \
+   tst-tls-ie-mod1 \
+   tst-tls-ie-mod2 \
+@@ -2710,3 +2714,14 @@ $(objpfx)tst-nodeps2-mod.so: $(common-objpfx)libc.so \
+ 	$(LINK.o) -Wl,--no-as-needed -nostartfiles -nostdlib -shared -o $@ $^
+ $(objpfx)tst-nodeps2.out: \
+   $(objpfx)tst-nodeps1-mod.so $(objpfx)tst-nodeps2-mod.so
++
++$(objpfx)tst-tlsgap: $(shared-thread-library)
++$(objpfx)tst-tlsgap.out: \
++  $(objpfx)tst-tlsgap-mod0.so \
++  $(objpfx)tst-tlsgap-mod1.so \
++  $(objpfx)tst-tlsgap-mod2.so
++ifeq (yes,$(have-mtls-dialect-gnu2))
++CFLAGS-tst-tlsgap-mod0.c += -mtls-dialect=gnu2
++CFLAGS-tst-tlsgap-mod1.c += -mtls-dialect=gnu2
++CFLAGS-tst-tlsgap-mod2.c += -mtls-dialect=gnu2
++endif
+diff --git a/elf/tst-tlsgap-mod0.c b/elf/tst-tlsgap-mod0.c
+new file mode 100644
+index 0000000000000000..1478b0beac5faf98
+--- /dev/null
++++ b/elf/tst-tlsgap-mod0.c
+@@ -0,0 +1,2 @@
++int __thread tls0;
++int *f0(void) { return &tls0; }
+diff --git a/elf/tst-tlsgap-mod1.c b/elf/tst-tlsgap-mod1.c
+new file mode 100644
+index 0000000000000000..b10fc3702c43e478
+--- /dev/null
++++ b/elf/tst-tlsgap-mod1.c
+@@ -0,0 +1,2 @@
++int __thread tls1[100]; /* Size > glibc.rtld.optional_static_tls / 2.  */
++int *f1(void) { return tls1; }
+diff --git a/elf/tst-tlsgap-mod2.c b/elf/tst-tlsgap-mod2.c
+new file mode 100644
+index 0000000000000000..166c27d7f3fac252
+--- /dev/null
++++ b/elf/tst-tlsgap-mod2.c
+@@ -0,0 +1,2 @@
++int __thread tls2;
++int *f2(void) { return &tls2; }
+diff --git a/elf/tst-tlsgap.c b/elf/tst-tlsgap.c
+new file mode 100644
+index 0000000000000000..49328850769c5609
+--- /dev/null
++++ b/elf/tst-tlsgap.c
+@@ -0,0 +1,92 @@
++/* TLS modid gap reuse regression test for bug 29039.
++   Copyright (C) 2023 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
++   <http://www.gnu.org/licenses/>.  */
++
++#include <stdio.h>
++#include <dlfcn.h>
++#include <pthread.h>
++#include <support/xdlfcn.h>
++#include <support/xthread.h>
++#include <support/check.h>
++
++static void *mod[3];
++#define MOD(i) "tst-tlsgap-mod" #i ".so"
++static const char *modname[3] = { MOD(0), MOD(1), MOD(2) };
++#undef MOD
++
++static void
++open_mod (int i)
++{
++  mod[i] = xdlopen (modname[i], RTLD_LAZY);
++  printf ("open %s\n", modname[i]);
++}
++
++static void
++close_mod (int i)
++{
++  xdlclose (mod[i]);
++  mod[i] = NULL;
++  printf ("close %s\n", modname[i]);
++}
++
++static void
++access_mod (int i, const char *sym)
++{
++  int *(*f) (void) = xdlsym (mod[i], sym);
++  int *p = f ();
++  printf ("access %s: %s() = %p\n", modname[i], sym, p);
++  TEST_VERIFY_EXIT (p != NULL);
++  ++*p;
++}
++
++static void *
++start (void *arg)
++{
++  /* The DTV generation is at the last dlopen of mod0 and the
++     entry for mod1 is NULL.  */
++
++  open_mod (1); /* Reuse modid of mod1. Uses dynamic TLS.  */
++
++  /* DTV is unchanged: dlopen only updates the DTV to the latest
++     generation if static TLS is allocated for a loaded module.
++
++     With bug 29039, the TLSDESC relocation in mod1 uses the old
++     dlclose generation of mod1 instead of the new dlopen one so
++     DTV is not updated on TLS access.  */
++
++  access_mod (1, "f1");
++
++  return arg;
++}
++
++static int
++do_test (void)
++{
++  open_mod (0);
++  open_mod (1);
++  open_mod (2);
++  close_mod (0);
++  close_mod (1); /* Create modid gap at mod1.  */
++  open_mod (0); /* Reuse modid of mod0, bump generation count.  */
++
++  /* Create a thread where DTV of mod1 is NULL.  */
++  pthread_t t = xpthread_create (NULL, start, NULL);
++  xpthread_join (t);
++  return 0;
++}
++
++#include <support/test-driver.c>
diff --git a/SOURCES/glibc-RHEL-19444.patch b/SOURCES/glibc-RHEL-19444.patch
new file mode 100644
index 0000000..2c03560
--- /dev/null
+++ b/SOURCES/glibc-RHEL-19444.patch
@@ -0,0 +1,29 @@
+commit 5eabdb6a6ac1599d23dd5966a37417215950245f
+Author: Andreas Schwab <schwab@suse.de>
+Date:   Wed Dec 6 14:48:22 2023 +0100
+
+    getaddrinfo: translate ENOMEM to EAI_MEMORY (bug 31163)
+    
+    When __resolv_context_get returns NULL due to out of memory, translate it
+    to a return value of EAI_MEMORY.
+
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index 321a6679d46494a3..8fe879c5420337a4 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -615,7 +615,14 @@ get_nss_addresses (const char *name, const struct addrinfo *req,
+      function variant.  */
+   res_ctx = __resolv_context_get ();
+   if (res_ctx == NULL)
+-    no_more = 1;
++    {
++      if (errno == ENOMEM)
++	{
++	  result = -EAI_MEMORY;
++	  goto out;
++	}
++      no_more = 1;
++    }
+ 
+   while (!no_more)
+     {
diff --git a/SOURCES/glibc-RHEL-19862.patch b/SOURCES/glibc-RHEL-19862.patch
new file mode 100644
index 0000000..f3aa27c
--- /dev/null
+++ b/SOURCES/glibc-RHEL-19862.patch
@@ -0,0 +1,27 @@
+commit ecc7c3deb9f347649c2078fcc0f94d4cedf92d60
+Author: Florian Weimer <fweimer@redhat.com>
+Date:   Tue Jan 2 14:36:17 2024 +0100
+
+    libio: Check remaining buffer size in _IO_wdo_write (bug 31183)
+    
+    The multibyte character needs to fit into the remaining buffer space,
+    not the already-written buffer space.  Without the fix, we were never
+    moving the write pointer from the start of the buffer, always using
+    the single-character fallback buffer.
+    
+    Fixes commit 04b76b5aa8b2d1d19066e42dd1 ("Don't error out writing
+    a multibyte character to an unbuffered stream (bug 17522)").
+
+diff --git a/libio/wfileops.c b/libio/wfileops.c
+index 37f44780f811bd38..6cbc3c7c968f9136 100644
+--- a/libio/wfileops.c
++++ b/libio/wfileops.c
+@@ -57,7 +57,7 @@ _IO_wdo_write (FILE *fp, const wchar_t *data, size_t to_do)
+ 	  char mb_buf[MB_LEN_MAX];
+ 	  char *write_base, *write_ptr, *buf_end;
+ 
+-	  if (fp->_IO_write_ptr - fp->_IO_write_base < sizeof (mb_buf))
++	  if (fp->_IO_buf_end - fp->_IO_write_ptr < sizeof (mb_buf))
+ 	    {
+ 	      /* Make sure we have room for at least one multibyte
+ 		 character.  */
diff --git a/SOURCES/glibc-RHEL-2123.patch b/SOURCES/glibc-RHEL-2123.patch
new file mode 100644
index 0000000..682d02b
--- /dev/null
+++ b/SOURCES/glibc-RHEL-2123.patch
@@ -0,0 +1,317 @@
+commit d2123d68275acc0f061e73d5f86ca504e0d5a344
+Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
+Date:   Tue Feb 16 12:55:13 2021 +0000
+
+    elf: Fix slow tls access after dlopen [BZ #19924]
+    
+    In short: __tls_get_addr checks the global generation counter and if
+    the current dtv is older then _dl_update_slotinfo updates dtv up to the
+    generation of the accessed module. So if the global generation is newer
+    than generation of the module then __tls_get_addr keeps hitting the
+    slow dtv update path. The dtv update path includes a number of checks
+    to see if any update is needed and this already causes measurable tls
+    access slow down after dlopen.
+    
+    It may be possible to detect up-to-date dtv faster.  But if there are
+    many modules loaded (> TLS_SLOTINFO_SURPLUS) then this requires at
+    least walking the slotinfo list.
+    
+    This patch tries to update the dtv to the global generation instead, so
+    after a dlopen the tls access slow path is only hit once.  The modules
+    with larger generation than the accessed one were not necessarily
+    synchronized before, so additional synchronization is needed.
+    
+    This patch uses acquire/release synchronization when accessing the
+    generation counter.
+    
+    Note: in the x86_64 version of dl-tls.c the generation is only loaded
+    once, since relaxed mo is not faster than acquire mo load.
+    
+    I have not benchmarked this. Tested by Adhemerval Zanella on aarch64,
+    powerpc, sparc, x86 who reported that it fixes the performance issue
+    of bug 19924.
+    
+    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+diff --git a/elf/dl-close.c b/elf/dl-close.c
+index 985cd4e2821436af..95a03c9616c6a786 100644
+--- a/elf/dl-close.c
++++ b/elf/dl-close.c
+@@ -739,7 +739,7 @@ _dl_close_worker (struct link_map *map, bool force)
+       if (__glibc_unlikely (newgen == 0))
+ 	_dl_fatal_printf ("TLS generation counter wrapped!  Please report as described in "REPORT_BUGS_TO".\n");
+       /* Can be read concurrently.  */
+-      atomic_store_relaxed (&GL(dl_tls_generation), newgen);
++      atomic_store_release (&GL(dl_tls_generation), newgen);
+ 
+       if (tls_free_end == GL(dl_tls_static_used))
+ 	GL(dl_tls_static_used) = tls_free_start;
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index 633b047ad2497296..c8a5d88161441031 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -404,7 +404,7 @@ update_tls_slotinfo (struct link_map *new)
+     _dl_fatal_printf (N_("\
+ TLS generation counter wrapped!  Please report this."));
+   /* Can be read concurrently.  */
+-  atomic_store_relaxed (&GL(dl_tls_generation), newgen);
++  atomic_store_release (&GL(dl_tls_generation), newgen);
+ 
+   /* We need a second pass for static tls data, because
+      _dl_update_slotinfo must not be run while calls to
+@@ -421,8 +421,8 @@ TLS generation counter wrapped!  Please report this."));
+ 	     now, but we can delay updating the DTV.  */
+ 	  imap->l_need_tls_init = 0;
+ #ifdef SHARED
+-	  /* Update the slot information data for at least the
+-	     generation of the DSO we are allocating data for.  */
++	  /* Update the slot information data for the current
++	     generation.  */
+ 
+ 	  /* FIXME: This can terminate the process on memory
+ 	     allocation failure.  It is not possible to raise
+@@ -430,7 +430,7 @@ TLS generation counter wrapped!  Please report this."));
+ 	     _dl_update_slotinfo would have to be split into two
+ 	     operations, similar to resize_scopes and update_scopes
+ 	     above.  This is related to bug 16134.  */
+-	  _dl_update_slotinfo (imap->l_tls_modid);
++	  _dl_update_slotinfo (imap->l_tls_modid, newgen);
+ #endif
+ 
+ 	  dl_init_static_tls (imap);
+diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
+index 5b69321bda1f2b27..be3e09e36835ed23 100644
+--- a/elf/dl-reloc.c
++++ b/elf/dl-reloc.c
+@@ -111,11 +111,11 @@ _dl_try_allocate_static_tls (struct link_map *map, bool optional)
+   if (map->l_real->l_relocated)
+     {
+ #ifdef SHARED
++      /* Update the DTV of the current thread.  Note: GL(dl_load_tls_lock)
++	 is held here so normal load of the generation counter is valid.  */
+       if (__builtin_expect (THREAD_DTV()[0].counter != GL(dl_tls_generation),
+ 			    0))
+-	/* Update the slot information data for at least the generation of
+-	   the DSO we are allocating data for.  */
+-	(void) _dl_update_slotinfo (map->l_tls_modid);
++	(void) _dl_update_slotinfo (map->l_tls_modid, GL(dl_tls_generation));
+ #endif
+ 
+       dl_init_static_tls (map);
+diff --git a/elf/dl-tls.c b/elf/dl-tls.c
+index fab6546e2d31edd4..b8ada16f1637c910 100644
+--- a/elf/dl-tls.c
++++ b/elf/dl-tls.c
+@@ -721,57 +721,57 @@ allocate_and_init (struct link_map *map)
+ 
+ 
+ struct link_map *
+-_dl_update_slotinfo (unsigned long int req_modid)
++_dl_update_slotinfo (unsigned long int req_modid, size_t new_gen)
+ {
+   struct link_map *the_map = NULL;
+   dtv_t *dtv = THREAD_DTV ();
+ 
+-  /* The global dl_tls_dtv_slotinfo array contains for each module
+-     index the generation counter current when the entry was created.
++  /* CONCURRENCY NOTES:
++
++     The global dl_tls_dtv_slotinfo_list array contains for each module
++     index the generation counter current when that entry was updated.
+      This array never shrinks so that all module indices which were
+-     valid at some time can be used to access it.  Before the first
+-     use of a new module index in this function the array was extended
+-     appropriately.  Access also does not have to be guarded against
+-     modifications of the array.  It is assumed that pointer-size
+-     values can be read atomically even in SMP environments.  It is
+-     possible that other threads at the same time dynamically load
+-     code and therefore add to the slotinfo list.  This is a problem
+-     since we must not pick up any information about incomplete work.
+-     The solution to this is to ignore all dtv slots which were
+-     created after the one we are currently interested.  We know that
+-     dynamic loading for this module is completed and this is the last
+-     load operation we know finished.  */
+-  unsigned long int idx = req_modid;
++     valid at some time can be used to access it.  Concurrent loading
++     and unloading of modules can update slotinfo entries or extend
++     the array.  The updates happen under the GL(dl_load_tls_lock) and
++     finish with the release store of the generation counter to
++     GL(dl_tls_generation) which is synchronized with the load of
++     new_gen in the caller.  So updates up to new_gen are synchronized
++     but updates for later generations may not be.
++
++     Here we update the thread dtv from old_gen (== dtv[0].counter) to
++     new_gen generation.  For this, each dtv[i] entry is either set to
++     an unallocated state (set), or left unmodified (nop).  Where (set)
++     may resize the dtv first if modid i >= dtv[-1].counter. The rules
++     for the decision between (set) and (nop) are
++
++     (1) If slotinfo entry i is concurrently updated then either (set)
++         or (nop) is valid: TLS access cannot use dtv[i] unless it is
++         synchronized with a generation > new_gen.
++
++     Otherwise, if the generation of slotinfo entry i is gen and the
++     loaded module for this entry is map then
++
++     (2) If gen <= old_gen then do (nop).
++
++     (3) If old_gen < gen <= new_gen then
++         (3.1) if map != 0 then (set)
++         (3.2) if map == 0 then either (set) or (nop).
++
++     Note that (1) cannot be reliably detected, but since both actions
++     are valid it does not have to be.  Only (2) and (3.1) cases need
++     to be distinguished for which relaxed mo access of gen and map is
++     enough: their value is synchronized when it matters.
++
++     Note that a relaxed mo load may give an out-of-thin-air value since
++     it is used in decisions that can affect concurrent stores.  But this
++     should only happen if the OOTA value causes UB that justifies the
++     concurrent store of the value.  This is not expected to be an issue
++     in practice.  */
+   struct dtv_slotinfo_list *listp = GL(dl_tls_dtv_slotinfo_list);
+ 
+-  while (idx >= listp->len)
++  if (dtv[0].counter < new_gen)
+     {
+-      idx -= listp->len;
+-      listp = listp->next;
+-    }
+-
+-  if (dtv[0].counter < listp->slotinfo[idx].gen)
+-    {
+-      /* CONCURRENCY NOTES:
+-
+-	 Here the dtv needs to be updated to new_gen generation count.
+-
+-	 This code may be called during TLS access when GL(dl_load_tls_lock)
+-	 is not held.  In that case the user code has to synchronize with
+-	 dlopen and dlclose calls of relevant modules.  A module m is
+-	 relevant if the generation of m <= new_gen and dlclose of m is
+-	 synchronized: a memory access here happens after the dlopen and
+-	 before the dlclose of relevant modules.  The dtv entries for
+-	 relevant modules need to be updated, other entries can be
+-	 arbitrary.
+-
+-	 This e.g. means that the first part of the slotinfo list can be
+-	 accessed race free, but the tail may be concurrently extended.
+-	 Similarly relevant slotinfo entries can be read race free, but
+-	 other entries are racy.  However updating a non-relevant dtv
+-	 entry does not affect correctness.  For a relevant module m,
+-	 max_modid >= modid of m.  */
+-      size_t new_gen = listp->slotinfo[idx].gen;
+       size_t total = 0;
+       size_t max_modid  = atomic_load_relaxed (&GL(dl_tls_max_dtv_idx));
+       assert (max_modid >= req_modid);
+@@ -784,31 +784,33 @@ _dl_update_slotinfo (unsigned long int req_modid)
+ 	    {
+ 	      size_t modid = total + cnt;
+ 
+-	      /* Later entries are not relevant.  */
++	      /* Case (1) for all later modids.  */
+ 	      if (modid > max_modid)
+ 		break;
+ 
+ 	      size_t gen = atomic_load_relaxed (&listp->slotinfo[cnt].gen);
+ 
++	      /* Case (1).  */
+ 	      if (gen > new_gen)
+-		/* Not relevant.  */
+ 		continue;
+ 
+-	      /* If the entry is older than the current dtv layout we
+-		 know we don't have to handle it.  */
++	      /* Case (2) or (1).  */
+ 	      if (gen <= dtv[0].counter)
+ 		continue;
+ 
++	      /* Case (3) or (1).  */
++
+ 	      /* If there is no map this means the entry is empty.  */
+ 	      struct link_map *map
+ 		= atomic_load_relaxed (&listp->slotinfo[cnt].map);
+ 	      /* Check whether the current dtv array is large enough.  */
+ 	      if (dtv[-1].counter < modid)
+ 		{
++		  /* Case (3.2) or (1).  */
+ 		  if (map == NULL)
+ 		    continue;
+ 
+-		  /* Resize the dtv.  */
++		  /* Resizing the dtv aborts on failure: bug 16134.  */
+ 		  dtv = _dl_resize_dtv (dtv, max_modid);
+ 
+ 		  assert (modid <= dtv[-1].counter);
+@@ -819,7 +821,7 @@ _dl_update_slotinfo (unsigned long int req_modid)
+ 		}
+ 
+ 	      /* If there is currently memory allocate for this
+-		 dtv entry free it.  */
++		 dtv entry free it.  Note: this is not AS-safe.  */
+ 	      /* XXX Ideally we will at some point create a memory
+ 		 pool.  */
+ 	      free (dtv[modid].pointer.to_free);
+@@ -914,9 +916,9 @@ tls_get_addr_tail (GET_ADDR_ARGS, dtv_t *dtv, struct link_map *the_map)
+ 
+ static struct link_map *
+ __attribute_noinline__
+-update_get_addr (GET_ADDR_ARGS)
++update_get_addr (GET_ADDR_ARGS, size_t gen)
+ {
+-  struct link_map *the_map = _dl_update_slotinfo (GET_ADDR_MODULE);
++  struct link_map *the_map = _dl_update_slotinfo (GET_ADDR_MODULE, gen);
+   dtv_t *dtv = THREAD_DTV ();
+ 
+   void *p = dtv[GET_ADDR_MODULE].pointer.val;
+@@ -946,12 +948,17 @@ __tls_get_addr (GET_ADDR_ARGS)
+   dtv_t *dtv = THREAD_DTV ();
+ 
+   /* Update is needed if dtv[0].counter < the generation of the accessed
+-     module.  The global generation counter is used here as it is easier
+-     to check.  Synchronization for the relaxed MO access is guaranteed
+-     by user code, see CONCURRENCY NOTES in _dl_update_slotinfo.  */
++     module, but the global generation counter is easier to check (which
++     must be synchronized up to the generation of the accessed module by
++     user code doing the TLS access so relaxed mo read is enough).  */
+   size_t gen = atomic_load_relaxed (&GL(dl_tls_generation));
+   if (__glibc_unlikely (dtv[0].counter != gen))
+-    return update_get_addr (GET_ADDR_PARAM);
++    {
++      /* Update DTV up to the global generation, see CONCURRENCY NOTES
++         in _dl_update_slotinfo.  */
++      gen = atomic_load_acquire (&GL(dl_tls_generation));
++      return update_get_addr (GET_ADDR_PARAM, gen);
++    }
+ 
+   void *p = dtv[GET_ADDR_MODULE].pointer.val;
+ 
+diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
+index 8c0fe98f69a88f1e..7964e133e4930e88 100644
+--- a/sysdeps/generic/ldsodefs.h
++++ b/sysdeps/generic/ldsodefs.h
+@@ -1304,7 +1304,8 @@ extern void _dl_add_to_slotinfo (struct link_map *l, bool do_add)
+ 
+ /* Update slot information data for at least the generation of the
+    module with the given index.  */
+-extern struct link_map *_dl_update_slotinfo (unsigned long int req_modid)
++extern struct link_map *_dl_update_slotinfo (unsigned long int req_modid,
++					     size_t gen)
+      attribute_hidden;
+ 
+ /* Look up the module's TLS block as for __tls_get_addr,
+diff --git a/sysdeps/x86_64/dl-tls.c b/sysdeps/x86_64/dl-tls.c
+index 24ef560b718275a2..4ded8dd6b94edc81 100644
+--- a/sysdeps/x86_64/dl-tls.c
++++ b/sysdeps/x86_64/dl-tls.c
+@@ -40,9 +40,9 @@ __tls_get_addr_slow (GET_ADDR_ARGS)
+ {
+   dtv_t *dtv = THREAD_DTV ();
+ 
+-  size_t gen = atomic_load_relaxed (&GL(dl_tls_generation));
++  size_t gen = atomic_load_acquire (&GL(dl_tls_generation));
+   if (__glibc_unlikely (dtv[0].counter != gen))
+-    return update_get_addr (GET_ADDR_PARAM);
++    return update_get_addr (GET_ADDR_PARAM, gen);
+ 
+   return tls_get_addr_tail (GET_ADDR_PARAM, dtv, NULL);
+ }
diff --git a/SOURCES/glibc-RHEL-21556.patch b/SOURCES/glibc-RHEL-21556.patch
new file mode 100644
index 0000000..31edb08
--- /dev/null
+++ b/SOURCES/glibc-RHEL-21556.patch
@@ -0,0 +1,33 @@
+commit c06c8aeb61708249d8eb0b17a676d16771ea640b
+Author: Dennis Brendel <dbrendel@redhat.com>
+Date:   Mon Jan 15 09:55:37 2024 +0100
+
+    manual: fix order of arguments of memalign and aligned_alloc (Bug 27547)
+    
+    On the summary page the order of the function arguments was reversed, but it is
+    in correct order in the other places of the manual.
+    
+    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+
+diff --git a/manual/memory.texi b/manual/memory.texi
+index fb875f4c3c..3710d7ec66 100644
+--- a/manual/memory.texi
++++ b/manual/memory.texi
+@@ -1502,7 +1502,7 @@ Space}.
+ Allocate a block of @var{size} bytes, starting on a page boundary.
+ @xref{Aligned Memory Blocks}.
+ 
+-@item void *aligned_alloc (size_t @var{size}, size_t @var{alignment})
++@item void *aligned_alloc (size_t @var{alignment}, size_t @var{size})
+ Allocate a block of @var{size} bytes, starting on an address that is a
+ multiple of @var{alignment}.  @xref{Aligned Memory Blocks}.
+ 
+@@ -1510,7 +1510,7 @@ multiple of @var{alignment}.  @xref{Aligned Memory Blocks}.
+ Allocate a block of @var{size} bytes, starting on an address that is a
+ multiple of @var{alignment}.  @xref{Aligned Memory Blocks}.
+ 
+-@item void *memalign (size_t @var{size}, size_t @var{boundary})
++@item void *memalign (size_t @var{boundary}, size_t @var{size})
+ Allocate a block of @var{size} bytes, starting on an address that is a
+ multiple of @var{boundary}.  @xref{Aligned Memory Blocks}.
+ 
diff --git a/SOURCES/glibc-RHEL-2338-1.patch b/SOURCES/glibc-RHEL-2338-1.patch
new file mode 100644
index 0000000..6dcac65
--- /dev/null
+++ b/SOURCES/glibc-RHEL-2338-1.patch
@@ -0,0 +1,47 @@
+commit c3b023a7822185c9176cfb96eeca4ada3d662c4b
+Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date:   Wed Nov 24 12:57:57 2021 -0300
+
+    linux: Only build fstatat fallback if required
+    
+    For 32-bit architecture with __ASSUME_STATX there is no need to
+    build fstatat64_time64_stat.
+    
+    Checked on i686-linux-gnu.
+
+diff --git a/sysdeps/unix/sysv/linux/fstatat64.c b/sysdeps/unix/sysv/linux/fstatat64.c
+index f968e4ef0594852e..50ae5ad74832efe1 100644
+--- a/sysdeps/unix/sysv/linux/fstatat64.c
++++ b/sysdeps/unix/sysv/linux/fstatat64.c
+@@ -74,6 +74,17 @@ fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf,
+   return r;
+ }
+ 
++#if (__WORDSIZE == 32 \
++     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
++     || defined STAT_HAS_TIME32
++# define FSTATAT_USE_STATX 1
++#else
++# define FSTATAT_USE_STATX 0
++#endif
++
++/* Only statx supports 64-bit timestamps for 32-bit architectures with
++   __ASSUME_STATX, so there is no point in building the fallback.  */
++#if !FSTATAT_USE_STATX || (FSTATAT_USE_STATX && !defined __ASSUME_STATX)
+ static inline int
+ fstatat64_time64_stat (int fd, const char *file, struct __stat64_t64 *buf,
+ 		       int flag)
+@@ -134,13 +145,6 @@ fstatat64_time64_stat (int fd, const char *file, struct __stat64_t64 *buf,
+ 
+   return r;
+ }
+-
+-#if (__WORDSIZE == 32 \
+-     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
+-     || defined STAT_HAS_TIME32
+-# define FSTATAT_USE_STATX 1
+-#else
+-# define FSTATAT_USE_STATX 0
+ #endif
+ 
+ int
diff --git a/SOURCES/glibc-RHEL-2338-2.patch b/SOURCES/glibc-RHEL-2338-2.patch
new file mode 100644
index 0000000..5372910
--- /dev/null
+++ b/SOURCES/glibc-RHEL-2338-2.patch
@@ -0,0 +1,36 @@
+commit c7f05bd5342517f3f751e6ea8dec1916b80bee8a
+Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date:   Wed Mar 9 18:35:39 2022 -0300
+
+    Fix ununsed fstatat64_time64_statx
+    
+    It is only called for legacy ABIs.
+
+diff --git a/sysdeps/unix/sysv/linux/fstatat64.c b/sysdeps/unix/sysv/linux/fstatat64.c
+index 50ae5ad74832efe1..45221bbdf901fa47 100644
+--- a/sysdeps/unix/sysv/linux/fstatat64.c
++++ b/sysdeps/unix/sysv/linux/fstatat64.c
+@@ -40,6 +40,11 @@ _Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t),
+                 "__blkcnt_t and __blkcnt64_t must match");
+ #endif
+ 
++#if (__WORDSIZE == 32 \
++     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
++     || defined STAT_HAS_TIME32
++# define FSTATAT_USE_STATX 1
++
+ static inline int
+ fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf,
+ 			int flag)
+@@ -73,11 +78,6 @@ fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf,
+ 
+   return r;
+ }
+-
+-#if (__WORDSIZE == 32 \
+-     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
+-     || defined STAT_HAS_TIME32
+-# define FSTATAT_USE_STATX 1
+ #else
+ # define FSTATAT_USE_STATX 0
+ #endif
diff --git a/SOURCES/glibc-RHEL-2338-3.patch b/SOURCES/glibc-RHEL-2338-3.patch
new file mode 100644
index 0000000..9ed0a1a
--- /dev/null
+++ b/SOURCES/glibc-RHEL-2338-3.patch
@@ -0,0 +1,30 @@
+commit e6547d635b991651600fab31f788ed5facd77610
+Author: WANG Xuerui <git@xen0n.name>
+Date:   Wed Jun 1 10:12:28 2022 +0800
+
+    linux: use statx for fstat if neither newfstatat nor fstatat64 is present
+    
+    LoongArch is going to be the first architecture supported by Linux that
+    has neither fstat* nor newfstatat [1], instead exclusively relying on
+    statx. So in fstatat64's implementation, we need to also enable statx
+    usage if neither fstatat64 nor newfstatat is present, to prepare for
+    this new case of kernel ABI.
+    
+    [1]: https://lore.kernel.org/all/20220518092619.1269111-1-chenhuacai@loongson.cn/
+    
+    Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+diff --git a/sysdeps/unix/sysv/linux/fstatat64.c b/sysdeps/unix/sysv/linux/fstatat64.c
+index 45221bbdf901fa47..ded431257bf3450f 100644
+--- a/sysdeps/unix/sysv/linux/fstatat64.c
++++ b/sysdeps/unix/sysv/linux/fstatat64.c
+@@ -42,7 +42,8 @@ _Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t),
+ 
+ #if (__WORDSIZE == 32 \
+      && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
+-     || defined STAT_HAS_TIME32
++     || defined STAT_HAS_TIME32 \
++     || (!defined __NR_newfstatat && !defined __NR_fstatat64)
+ # define FSTATAT_USE_STATX 1
+ 
+ static inline int
diff --git a/SOURCES/glibc-RHEL-2338-4.patch b/SOURCES/glibc-RHEL-2338-4.patch
new file mode 100644
index 0000000..4534dfd
--- /dev/null
+++ b/SOURCES/glibc-RHEL-2338-4.patch
@@ -0,0 +1,157 @@
+commit 551101e8240b7514fc646d1722f8b79c90362b8f
+Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date:   Mon Sep 11 10:25:48 2023 -0300
+
+    io: Do not implement fstat with fstatat
+    
+    AT_EMPTY_PATH is a requirement to implement fstat over fstatat,
+    however it does not prevent the kernel to read the path argument.
+    It is not an issue, but on x86-64 with SMAP-capable CPUs the kernel is
+    forced to perform expensive user memory access.  After that regular
+    lookup is performed which adds even more overhead.
+    
+    Instead, issue the fstat syscall directly on LFS fstat implementation
+    (32 bit architectures will still continue to use statx, which is
+    required to have 64 bit time_t support).  it should be even a
+    small performance gain on non x86_64, since there is no need
+    to handle the path argument.
+    
+    Checked on x86_64-linux-gnu.
+
+diff --git a/sysdeps/unix/sysv/linux/fstat64.c b/sysdeps/unix/sysv/linux/fstat64.c
+index 46de80b663b9c1c4..fe4f57065f8713d2 100644
+--- a/sysdeps/unix/sysv/linux/fstat64.c
++++ b/sysdeps/unix/sysv/linux/fstat64.c
+@@ -19,20 +19,53 @@
+ #define __fstat __redirect___fstat
+ #define fstat   __redirect_fstat
+ #include <sys/stat.h>
++#undef __fstat
++#undef fstat
+ #include <fcntl.h>
+-#include <kernel_stat.h>
+-#include <stat_t64_cp.h>
++#include <internal-stat.h>
+ #include <errno.h>
+ 
+ int
+ __fstat64_time64 (int fd, struct __stat64_t64 *buf)
+ {
++#if !FSTATAT_USE_STATX
++# if XSTAT_IS_XSTAT64
++#  ifdef __NR_fstat
++  /* 64-bit kABI, e.g. aarch64, ia64, powerpc64*, s390x, riscv64, and
++     x86_64.  */
++  return INLINE_SYSCALL_CALL (fstat, fd, buf);
++#  elif defined __NR_fstat64
++#   if STAT64_IS_KERNEL_STAT64
++  /* 64-bit kABI outlier, e.g. alpha  */
++  return INLINE_SYSCALL_CALL (fstat64, fd, buf);
++#   else
++  /* 64-bit kABI outlier, e.g. sparc64.  */
++  struct kernel_stat64 kst64;
++  int r = INLINE_SYSCALL_CALL (fstat64, fd, &kst64);
++  if (r == 0)
++    __cp_stat64_kstat64 (buf, &kst64);
++  return r;
++#   endif /* STAT64_IS_KERNEL_STAT64 */
++#  endif
++# else /* XSTAT_IS_XSTAT64 */
++  /* 64-bit kabi outlier, e.g. mips64 and mips64-n32.  */
++  struct kernel_stat kst;
++  int r = INLINE_SYSCALL_CALL (fstat, fd, &kst);
++  if (r == 0)
++    __cp_kstat_stat64_t64 (&kst, buf);
++  return r;
++# endif
++#else /* !FSTATAT_USE_STATX  */
++  /* All kABIs with non-LFS support and with old 32-bit time_t support
++     e.g. arm, csky, i386, hppa, m68k, microblaze, nios2, sh, powerpc32,
++     and sparc32.  */
+   if (fd < 0)
+     {
+       __set_errno (EBADF);
+       return -1;
+     }
+   return __fstatat64_time64 (fd, "", buf, AT_EMPTY_PATH);
++#endif
+ }
+ #if __TIMESIZE != 64
+ hidden_def (__fstat64_time64)
+diff --git a/sysdeps/unix/sysv/linux/fstatat64.c b/sysdeps/unix/sysv/linux/fstatat64.c
+index ded431257bf3450f..8e9db7b11f0e1cf3 100644
+--- a/sysdeps/unix/sysv/linux/fstatat64.c
++++ b/sysdeps/unix/sysv/linux/fstatat64.c
+@@ -21,12 +21,10 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <string.h>
+-#include <kernel_stat.h>
+ #include <sysdep.h>
+ #include <time.h>
+-#include <kstat_cp.h>
+-#include <stat_t64_cp.h>
+ #include <sys/sysmacros.h>
++#include <internal-stat.h>
+ 
+ #if __TIMESIZE == 64 \
+      && (__WORDSIZE == 32 \
+@@ -40,11 +38,7 @@ _Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t),
+                 "__blkcnt_t and __blkcnt64_t must match");
+ #endif
+ 
+-#if (__WORDSIZE == 32 \
+-     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
+-     || defined STAT_HAS_TIME32 \
+-     || (!defined __NR_newfstatat && !defined __NR_fstatat64)
+-# define FSTATAT_USE_STATX 1
++#if FSTATAT_USE_STATX
+ 
+ static inline int
+ fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf,
+@@ -79,8 +73,6 @@ fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf,
+ 
+   return r;
+ }
+-#else
+-# define FSTATAT_USE_STATX 0
+ #endif
+ 
+ /* Only statx supports 64-bit timestamps for 32-bit architectures with
+diff --git a/sysdeps/unix/sysv/linux/internal-stat.h b/sysdeps/unix/sysv/linux/internal-stat.h
+new file mode 100644
+index 0000000000000000..e3b05698532fb185
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/internal-stat.h
+@@ -0,0 +1,31 @@
++/* Internal stat definitions.
++   Copyright (C) 2023 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>
++#include <stat_t64_cp.h>
++#include <kernel_stat.h>
++#include <kstat_cp.h>
++
++#if (__WORDSIZE == 32 \
++     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
++     || defined STAT_HAS_TIME32 \
++     || (!defined __NR_newfstatat && !defined __NR_fstatat64)
++# define FSTATAT_USE_STATX 1
++#else
++# define FSTATAT_USE_STATX 0
++#endif
diff --git a/SOURCES/glibc-RHEL-2491.patch b/SOURCES/glibc-RHEL-2491.patch
new file mode 100644
index 0000000..79f18b8
--- /dev/null
+++ b/SOURCES/glibc-RHEL-2491.patch
@@ -0,0 +1,112 @@
+commit 849274d48fc59bfa6db3c713c8ced8026b20f3b7
+Author: Florian Weimer <fweimer@redhat.com>
+Date:   Thu Nov 16 19:55:35 2023 +0100
+
+    elf: Fix force_first handling in dlclose (bug 30981)
+    
+    The force_first parameter was ineffective because the dlclose'd
+    object was not necessarily the first in the maps array.  Also
+    enable force_first handling unconditionally, regardless of namespace.
+    The initial object in a namespace should be destructed first, too.
+    
+    The _dl_sort_maps_dfs function had early returns for relocation
+    dependency processing which broke force_first handling, too, and
+    this is fixed in this change as well.
+    
+    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+diff --git a/elf/dl-close.c b/elf/dl-close.c
+index 95a03c9616c6a786..9d158c25498fd8ae 100644
+--- a/elf/dl-close.c
++++ b/elf/dl-close.c
+@@ -182,6 +182,16 @@ _dl_close_worker (struct link_map *map, bool force)
+     }
+   assert (idx == nloaded);
+ 
++  /* Put the dlclose'd map first, so that its destructor runs first.
++     The map variable is NULL after a retry.  */
++  if (map != NULL)
++    {
++      maps[map->l_idx] = maps[0];
++      maps[map->l_idx]->l_idx = map->l_idx;
++      maps[0] = map;
++      maps[0]->l_idx = 0;
++    }
++
+   /* Keep track of the lowest index link map we have covered already.  */
+   int done_index = -1;
+   while (++done_index < nloaded)
+@@ -255,9 +265,10 @@ _dl_close_worker (struct link_map *map, bool force)
+ 	  }
+     }
+ 
+-  /* Sort the entries.  We can skip looking for the binary itself which is
+-     at the front of the search list for the main namespace.  */
+-  _dl_sort_maps (maps, nloaded, (nsid == LM_ID_BASE), true);
++  /* Sort the entries.  Unless retrying, the maps[0] object (the
++     original argument to dlclose) needs to remain first, so that its
++     destructor runs first.  */
++  _dl_sort_maps (maps, nloaded, /* force_first */ map != NULL, true);
+ 
+   /* Call all termination functions at once.  */
+   bool unload_any = false;
+@@ -768,7 +779,11 @@ _dl_close_worker (struct link_map *map, bool force)
+   /* Recheck if we need to retry, release the lock.  */
+  out:
+   if (dl_close_state == rerun)
+-    goto retry;
++    {
++      /* The map may have been deallocated.  */
++      map = NULL;
++      goto retry;
++    }
+ 
+   dl_close_state = not_pending;
+ }
+diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
+index e8ef5e8b3588ab53..937feb6e7008bc62 100644
+--- a/elf/dl-sort-maps.c
++++ b/elf/dl-sort-maps.c
+@@ -260,13 +260,12 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
+ 	     The below memcpy is not needed in the do_reldeps case here,
+ 	     since we wrote back to maps[] during DFS traversal.  */
+ 	  if (maps_head == maps)
+-	    return;
++	    break;
+ 	}
+       assert (maps_head == maps);
+-      return;
+     }
+-
+-  memcpy (maps, rpo, sizeof (struct link_map *) * nmaps);
++  else
++    memcpy (maps, rpo, sizeof (struct link_map *) * nmaps);
+ 
+   /* Skipping the first object at maps[0] is not valid in general,
+      since traversing along object dependency-links may "find" that
+diff --git a/elf/dso-sort-tests-1.def b/elf/dso-sort-tests-1.def
+index 4bf9052db16fb352..cf6453e9eb85ac65 100644
+--- a/elf/dso-sort-tests-1.def
++++ b/elf/dso-sort-tests-1.def
+@@ -56,14 +56,16 @@ output: b>a>{}<a<b
+ # relocation(dynamic) dependencies. While this is technically unspecified, the
+ # presumed reasonable practical behavior is for the destructor order to respect
+ # the static DT_NEEDED links (here this means the a->b->c->d order).
+-# The older dynamic_sort=1 algorithm does not achieve this, while the DFS-based
+-# dynamic_sort=2 algorithm does, although it is still arguable whether going
+-# beyond spec to do this is the right thing to do.
++# The older dynamic_sort=1 algorithm originally did not achieve this,
++# but this was a bug in the way _dl_sort_maps was called from _dl_close_worker,
++# effectively disabling proper force_first handling.
++# The new dynamic_sort=2 algorithm shows the effect of the simpler force_first
++# handling: the a object is simply moved to the front.
+ # The below expected outputs are what the two algorithms currently produce
+ # respectively, for regression testing purposes.
+ tst-bz15311: {+a;+e;+f;+g;+d;%d;-d;-g;-f;-e;-a};a->b->c->d;d=>[ba];c=>a;b=>e=>a;c=>f=>b;d=>g=>c
+-output(glibc.rtld.dynamic_sort=1): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<a<c<d<g<f<b<e];}
+-output(glibc.rtld.dynamic_sort=2): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<g<f<a<b<c<d<e];}
++output(glibc.rtld.dynamic_sort=1): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<a<b<c<d<g<f<e];}
++output(glibc.rtld.dynamic_sort=2): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<a<g<f<b<c<d<e];}
+ 
+ # Test that even in the presence of dependency loops involving dlopen'ed
+ # object, that object is initialized last (and not unloaded prematurely).
diff --git a/SOURCES/glibc-RHEL-3397.patch b/SOURCES/glibc-RHEL-3397.patch
new file mode 100644
index 0000000..7dbd1e4
--- /dev/null
+++ b/SOURCES/glibc-RHEL-3397.patch
@@ -0,0 +1,83 @@
+commit c00b984fcd53f679ca2dafcd1aee2c89836e6e73
+Author: Florian Weimer <fweimer@redhat.com>
+Date:   Tue Aug 29 08:28:31 2023 +0200
+
+    nscd: Skip unusable entries in first pass in prune_cache (bug 30800)
+    
+    Previously, if an entry was marked unusable for any reason, but had
+    not timed out yet, the assert would trigger.
+    
+    One way to get into such state is if a data change is detected during
+    re-validation of an entry.  This causes the entry to be marked as not
+    usable.  If exits nscd soon after that, then the clock jumps
+    backwards, and nscd restarted, the cache re-validation run after
+    startup triggers the removed assert.
+    
+    The change is more complicated than just the removal of the assert
+    because entries marked as not usable should be garbage-collected in
+    the second pass.  To make this happen, it is necessary to update some
+    book-keeping data.
+    
+    Reviewed-by: DJ Delorie <dj@redhat.com>
+
+diff --git a/nscd/cache.c b/nscd/cache.c
+index 78b2269788699e6f..ac5902ae10b791bb 100644
+--- a/nscd/cache.c
++++ b/nscd/cache.c
+@@ -371,8 +371,11 @@ prune_cache (struct database_dyn *table, time_t now, int fd)
+ 		       serv2str[runp->type], str, dh->timeout);
+ 	    }
+ 
+-	  /* Check whether the entry timed out.  */
+-	  if (dh->timeout < now)
++	  /* Check whether the entry timed out.  Timed out entries
++	     will be revalidated.  For unusable records, it is still
++	     necessary to record that the bucket needs to be scanned
++	     again below.  */
++	  if (dh->timeout < now || !dh->usable)
+ 	    {
+ 	      /* This hash bucket could contain entries which need to
+ 		 be looked at.  */
+@@ -384,7 +387,7 @@ prune_cache (struct database_dyn *table, time_t now, int fd)
+ 	      /* We only have to look at the data of the first entries
+ 		 since the count information is kept in the data part
+ 		 which is shared.  */
+-	      if (runp->first)
++	      if (runp->first && dh->usable)
+ 		{
+ 
+ 		  /* At this point there are two choices: we reload the
+@@ -400,9 +403,6 @@ prune_cache (struct database_dyn *table, time_t now, int fd)
+ 		    {
+ 		      /* Remove the value.  */
+ 		      dh->usable = false;
+-
+-		      /* We definitely have some garbage entries now.  */
+-		      any = true;
+ 		    }
+ 		  else
+ 		    {
+@@ -414,18 +414,15 @@ prune_cache (struct database_dyn *table, time_t now, int fd)
+ 
+ 		      time_t timeout = readdfcts[runp->type] (table, runp, dh);
+ 		      next_timeout = MIN (next_timeout, timeout);
+-
+-		      /* If the entry has been replaced, we might need
+-			 cleanup.  */
+-		      any |= !dh->usable;
+ 		    }
+ 		}
++
++	      /* If the entry has been replaced, we might need cleanup.  */
++	      any |= !dh->usable;
+ 	    }
+ 	  else
+-	    {
+-	      assert (dh->usable);
+-	      next_timeout = MIN (next_timeout, dh->timeout);
+-	    }
++	    /* Entry has not timed out and is usable.  */
++	    next_timeout = MIN (next_timeout, dh->timeout);
+ 
+ 	  run = runp->next;
+ 	}
diff --git a/SOURCES/glibc-rhel-17157.patch b/SOURCES/glibc-rhel-17157.patch
new file mode 100644
index 0000000..5ea1f99
--- /dev/null
+++ b/SOURCES/glibc-rhel-17157.patch
@@ -0,0 +1,95 @@
+commit 472894d2cfee5751b44c0aaa71ed87df81c8e62e
+Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date:   Wed Oct 11 13:43:56 2023 -0300
+
+    malloc: Use __get_nprocs on arena_get2 (BZ 30945)
+    
+    This restore the 2.33 semantic for arena_get2.  It was changed by
+    11a02b035b46 to avoid arena_get2 call malloc (back when __get_nproc
+    was refactored to use an scratch_buffer - 903bc7dcc2acafc).  The
+    __get_nproc was refactored over then and now it also avoid to call
+    malloc.
+    
+    The 11a02b035b46 did not take in consideration any performance
+    implication, which should have been discussed properly.  The
+    __get_nprocs_sched is still used as a fallback mechanism if procfs
+    and sysfs is not acessible.
+    
+    Checked on x86_64-linux-gnu.
+    Reviewed-by: DJ Delorie <dj@redhat.com>
+
+diff --git a/include/sys/sysinfo.h b/include/sys/sysinfo.h
+index c490561581..65742b1036 100644
+--- a/include/sys/sysinfo.h
++++ b/include/sys/sysinfo.h
+@@ -14,10 +14,6 @@ libc_hidden_proto (__get_nprocs_conf)
+ extern int __get_nprocs (void);
+ libc_hidden_proto (__get_nprocs)
+ 
+-/* Return the number of available processors which the process can
+-   be scheduled.  */
+-extern int __get_nprocs_sched (void) attribute_hidden;
+-
+ /* Return number of physical pages of memory in the system.  */
+ extern long int __get_phys_pages (void);
+ libc_hidden_proto (__get_phys_pages)
+diff --git a/malloc/arena.c b/malloc/arena.c
+index d1e214ac2e..a1a75e5a2b 100644
+--- a/malloc/arena.c
++++ b/malloc/arena.c
+@@ -824,7 +824,7 @@ arena_get2 (size_t size, mstate avoid_arena)
+             narenas_limit = mp_.arena_max;
+           else if (narenas > mp_.arena_test)
+             {
+-              int n = __get_nprocs_sched ();
++              int n = __get_nprocs ();
+ 
+               if (n >= 1)
+                 narenas_limit = NARENAS_FROM_NCORES (n);
+diff --git a/misc/getsysstats.c b/misc/getsysstats.c
+index 5f36adc0e8..23cc112074 100644
+--- a/misc/getsysstats.c
++++ b/misc/getsysstats.c
+@@ -44,12 +44,6 @@ weak_alias (__get_nprocs, get_nprocs)
+ link_warning (get_nprocs, "warning: get_nprocs will always return 1")
+ 
+ 
+-int
+-__get_nprocs_sched (void)
+-{
+-  return 1;
+-}
+-
+ long int
+ __get_phys_pages (void)
+ {
+diff --git a/sysdeps/mach/getsysstats.c b/sysdeps/mach/getsysstats.c
+index 5184e5eee1..d3834f3b69 100644
+--- a/sysdeps/mach/getsysstats.c
++++ b/sysdeps/mach/getsysstats.c
+@@ -62,12 +62,6 @@ __get_nprocs (void)
+ libc_hidden_def (__get_nprocs)
+ weak_alias (__get_nprocs, get_nprocs)
+ 
+-int
+-__get_nprocs_sched (void)
+-{
+-  return __get_nprocs ();
+-}
+-
+ /* Return the number of physical pages on the system. */
+ long int
+ __get_phys_pages (void)
+diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c
+index b0b6c154ac..1ea7f1f01f 100644
+--- a/sysdeps/unix/sysv/linux/getsysstats.c
++++ b/sysdeps/unix/sysv/linux/getsysstats.c
+@@ -29,7 +29,7 @@
+ #include <sys/sysinfo.h>
+ #include <sysdep.h>
+ 
+-int
++static int
+ __get_nprocs_sched (void)
+ {
+   enum
diff --git a/SPECS/glibc.spec b/SPECS/glibc.spec
index 15f0b37..a573345 100644
--- a/SPECS/glibc.spec
+++ b/SPECS/glibc.spec
@@ -155,7 +155,7 @@ end \
 Summary: The GNU libc libraries
 Name: glibc
 Version: %{glibcversion}
-Release: 83%{?dist}.7
+Release: 100%{?dist}
 
 # In general, GPLv2+ is used by programs, LGPLv2+ is used for
 # libraries.
@@ -770,6 +770,44 @@ Patch533: glibc-RHEL-2426-13.patch
 Patch534: glibc-RHEL-3000.patch
 Patch535: glibc-RHEL-2426-14.patch
 Patch536: glibc-RHEL-2426-15.patch
+Patch537: glibc-RHEL-1191.patch
+Patch538: glibc-RHEL-3397.patch
+Patch539: glibc-RHEL-2123.patch
+Patch540: glibc-RHEL-16275.patch
+Patch541: glibc-RHEL-2491.patch
+Patch542: glibc-RHEL-14383-1.patch
+Patch543: glibc-RHEL-14383-2.patch
+Patch544: glibc-RHEL-2338-1.patch
+Patch545: glibc-RHEL-2338-2.patch
+Patch546: glibc-RHEL-2338-3.patch
+Patch547: glibc-RHEL-2338-4.patch
+Patch548: glibc-RHEL-15343-1.patch
+Patch549: glibc-RHEL-15343-2.patch
+Patch550: glibc-RHEL-15343-3.patch
+Patch551: glibc-RHEL-15343-4.patch
+Patch552: glibc-rhel-17157.patch
+Patch553: glibc-RHEL-16016-1.patch
+Patch554: glibc-RHEL-16016-2.patch
+Patch555: glibc-RHEL-16016-3.patch
+Patch556: glibc-RHEL-16016-4.patch
+Patch557: glibc-RHEL-16016-5.patch
+Patch558: glibc-RHEL-16016-6.patch
+Patch559: glibc-RHEL-16016-7.patch
+Patch560: glibc-RHEL-17319-1.patch
+Patch561: glibc-RHEL-17319-2.patch
+Patch562: glibc-RHEL-17319-3.patch
+Patch563: glibc-RHEL-17319-4.patch
+Patch564: glibc-RHEL-17465-1.patch
+Patch565: glibc-RHEL-17465-2.patch
+Patch566: glibc-RHEL-19862.patch
+Patch567: glibc-RHEL-16643-1.patch
+Patch568: glibc-RHEL-16643-2.patch
+Patch569: glibc-RHEL-16643-3.patch
+Patch570: glibc-RHEL-16643-4.patch
+Patch571: glibc-RHEL-16643-5.patch
+Patch572: glibc-RHEL-16643-6.patch
+Patch573: glibc-RHEL-19444.patch
+Patch574: glibc-RHEL-21556.patch
 
 ##############################################################################
 # Continued list of core "glibc" package information:
@@ -1937,6 +1975,7 @@ gzip -9nvf %{glibc_sysroot}%{_infodir}/libc*
 # Copy the debugger interface documentation over to the right location
 mkdir -p %{glibc_sysroot}%{_docdir}/glibc
 cp elf/rtld-debugger-interface.txt %{glibc_sysroot}%{_docdir}/glibc
+cp posix/gai.conf %{glibc_sysroot}%{_docdir}/glibc
 %else
 rm -f %{glibc_sysroot}%{_infodir}/dir
 rm -f %{glibc_sysroot}%{_infodir}/libc.info*
@@ -2927,6 +2966,58 @@ update_gconv_modules_cache ()
 %endif
 
 %changelog
+* Wed Jan 24 2024 Patsy Griffin <patsy@redhat.com> - 2.34-100
+- manual: fix order of arguments of memalign and aligned_alloc (RHEL-21556)
+
+* Tue Jan 09 2024 Arjun Shankar <arjun@redhat.com> - 2.34-99
+- getaddrinfo: Return correct error EAI_MEMORY when out-of-memory (RHEL-19444)
+
+* Mon Jan  8 2024 Arjun Shankar <arjun@redhat.com> - 2.34-98
+- getaddrinfo: Fix occasionally empty result due to nscd cache order (RHEL-16643)
+
+* Tue Jan  2 2024 Florian Weimer <fweimer@redhat.com> - 2.34-97
+- Re-enable output buffering for wide stdio streams (RHEL-19862)
+
+* Thu Dec 21 2023 Carlos O'Donell <carlos@redhat.com> - 2.34-96
+- Fix TLS corruption during dlopen()/dlclose() sequences (RHEL-17465)
+
+* Fri Dec  8 2023 Florian Weimer <fweimer@redhat.com> - 2.34-95
+- Improve compatibility between underlinking and IFUNC resolvers (RHEL-17319)
+
+* Thu Dec  7 2023 Patsy Griffin <patsy@redhat.com> - 2.34-94
+- Update syscall-names.list for Linux 6.6. (RHEL-16016)
+
+* Wed Dec  6 2023 Patsy Griffin <patsy@redhat.com> - 2.34-93
+- malloc: Use __get_nprocs on arena_get2. (RHEL-17157)
+
+* Fri Dec  1 2023 Patsy Griffin <patsy@redhat.com> - 2.34-92
+- Improve test coverage for wcsdup, strdup and strndup. (RHEL-15343)
+
+* Fri Nov 24 2023 Florian Weimer <fweimer@redhat.com> - 2.34-91
+- fstat performance enhancement (RHEL-2338)
+
+* Tue Nov 21 2023 Florian Weimer <fweimer@redhat.com> - 2.34-90
+- ldconfig should skip temporary files created by RPM (RHEL-14383)
+
+* Mon Nov 20 2023 Florian Weimer <fweimer@redhat.com> - 2.34-89
+- Fix force-first handling in dlclose (RHEL-2491)
+
+* Wed Nov 15 2023 Arjun Shankar <arjun@redhat.com> - 2.34-88
+- nscd: Refer to /run instead of /var/run in systemd socket file
+  (RHEL-16275)
+
+* Fri Nov 10 2023 Florian Weimer <fweimer@redhat.com> - 2.34-87
+- Fix slow tls access after dlopen (RHEL-2123)
+
+* Tue Oct 24 2023 Arjun Shankar <arjun@redhat.com> - 2.34-86
+- Add /usr/share/doc/glibc/gai.conf to glibc-doc (RHEL-14545)
+
+* Fri Oct 20 2023 Florian Weimer <fweimer@redhat.com> - 2.34-85
+- nscd: Skip unusable entries in first pass in prune_cache (RHEL-3397)
+
+* Mon Oct  9 2023 Florian Weimer <fweimer@redhat.com> - 2.34-84
+- x86-64: Report non-zero cache sizes under TDX hypervisors (RHEL-1191)
+
 * Mon Sep 25 2023 Florian Weimer <fweimer@redhat.com> - 2.34-83.7
 - Fix memory leak regression in getaddrinfo (RHEL-2426)
 
-- 
GitLab