diff --git a/glibc-rh2224289-1.patch b/glibc-rh2224289-1.patch new file mode 100644 index 0000000..95cc0de --- /dev/null +++ b/glibc-rh2224289-1.patch @@ -0,0 +1,32 @@ +commit 3edc4ff2ceff4a59587ebecb94148d3bcfa1df62 +Author: Paul Eggert +Date: Wed Jul 19 14:09:26 2023 -0700 + + make ‘struct pthread’ a complete type + + * nptl/descr.h (struct pthread): Remove end_padding member, which + made this type incomplete. + (PTHREAD_STRUCT_END_PADDING): Stop using end_padding. + + Reviewed-by: Siddhesh Poyarekar + +diff --git a/nptl/descr.h b/nptl/descr.h +index dfef9c4bda075d13..c487846c171f9434 100644 +--- a/nptl/descr.h ++++ b/nptl/descr.h +@@ -412,11 +412,11 @@ struct pthread + /* rseq area registered with the kernel. */ + struct rseq rseq_area; + +- /* This member must be last. */ +- char end_padding[]; +- ++ /* Amount of end padding, if any, in this structure. ++ This definition relies on rseq_area being last. */ + #define PTHREAD_STRUCT_END_PADDING \ +- (sizeof (struct pthread) - offsetof (struct pthread, end_padding)) ++ (sizeof (struct pthread) - offsetof (struct pthread, rseq_area) \ ++ + sizeof (struct rseq)) + } __attribute ((aligned (TCB_ALIGNMENT))); + + static inline bool diff --git a/glibc-rh2224289-2.patch b/glibc-rh2224289-2.patch new file mode 100644 index 0000000..16ca496 --- /dev/null +++ b/glibc-rh2224289-2.patch @@ -0,0 +1,56 @@ +commit 2c6b4b272e6b4d07303af25709051c3e96288f2d +Author: Florian Weimer +Date: Fri Jul 21 16:18:18 2023 +0200 + + nptl: Unconditionally use a 32-byte rseq area + + If the kernel headers provide a larger struct rseq, we used that + size as the argument to the rseq system call. As a result, + rseq registration would fail on older kernels which only accept + size 32. + +Conflicts: + nptl/descr.h + (upstream has an additional #include ) + +diff --git a/nptl/descr.h b/nptl/descr.h +index c487846c171f9434..eded9eca38e7275e 100644 +--- a/nptl/descr.h ++++ b/nptl/descr.h +@@ -35,7 +35,6 @@ + #include + #include + #include +-#include + + #ifndef TCB_ALIGNMENT + # define TCB_ALIGNMENT 32 +@@ -409,14 +408,25 @@ struct pthread + /* Used on strsignal. */ + struct tls_internal_t tls_state; + +- /* rseq area registered with the kernel. */ +- struct rseq rseq_area; ++ /* rseq area registered with the kernel. Use a custom definition ++ here to isolate from kernel struct rseq changes. The ++ implementation of sched_getcpu needs acccess to the cpu_id field; ++ the other fields are unused and not included here. */ ++ union ++ { ++ struct ++ { ++ uint32_t cpu_id_start; ++ uint32_t cpu_id; ++ }; ++ char pad[32]; /* Original rseq area size. */ ++ } rseq_area __attribute__ ((aligned (32))); + + /* Amount of end padding, if any, in this structure. + This definition relies on rseq_area being last. */ + #define PTHREAD_STRUCT_END_PADDING \ + (sizeof (struct pthread) - offsetof (struct pthread, rseq_area) \ +- + sizeof (struct rseq)) ++ + sizeof ((struct pthread) {}.rseq_area)) + } __attribute ((aligned (TCB_ALIGNMENT))); + + static inline bool diff --git a/glibc.spec b/glibc.spec index 94191ec..6244b56 100644 --- a/glibc.spec +++ b/glibc.spec @@ -155,7 +155,7 @@ end \ Summary: The GNU libc libraries Name: glibc Version: %{glibcversion} -Release: 73%{?dist} +Release: 74%{?dist} # In general, GPLv2+ is used by programs, LGPLv2+ is used for # libraries. @@ -731,6 +731,8 @@ Patch490: glibc-rh2222188-2.patch Patch491: glibc-rh2222188-3.patch Patch492: glibc-rh2222188-4.patch Patch493: glibc-rh2222188-5.patch +Patch494: glibc-rh2224289-1.patch +Patch495: glibc-rh2224289-2.patch ############################################################################## # Continued list of core "glibc" package information: @@ -2888,6 +2890,9 @@ update_gconv_modules_cache () %endif %changelog +* Fri Jul 21 2023 Florian Weimer - 2.34-74 +- rseq_area should always be 32 bytes large (#2224289) + * Thu Jul 20 2023 Florian Weimer - 2.34-73 - GCC Toolset 13 C++ compatibility for iseqsig (#2222188)