···11+commit 6d1e3fb07b45e2e31e469b16cf21b24bccf8914c
22+Author: Andreas K. Hüttel <dilfridge@gentoo.org>
33+Date: Wed Jan 31 02:12:43 2024 +0100
44+55+ Replace advisories directory
66+77+ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
88+99+diff --git a/ADVISORIES b/ADVISORIES
1010+new file mode 100644
1111+index 0000000000..d4e33f2df3
1212+--- /dev/null
1313++++ b/ADVISORIES
1414+@@ -0,0 +1,2 @@
1515++For the GNU C Library Security Advisories, see the git master branch:
1616++https://sourceware.org/git/?p=glibc.git;a=tree;f=advisories;hb=HEAD
1717+diff --git a/advisories/GLIBC-SA-2023-0001 b/advisories/GLIBC-SA-2023-0001
1818+deleted file mode 100644
1919+index 3d19c91b6a..0000000000
2020+--- a/advisories/GLIBC-SA-2023-0001
2121++++ /dev/null
2222+@@ -1,14 +0,0 @@
2323+-printf: incorrect output for integers with thousands separator and width field
2424+-
2525+-When the printf family of functions is called with a format specifier
2626+-that uses an <apostrophe> (enable grouping) and a minimum width
2727+-specifier, the resulting output could be larger than reasonably expected
2828+-by a caller that computed a tight bound on the buffer size. The
2929+-resulting larger than expected output could result in a buffer overflow
3030+-in the printf family of functions.
3131+-
3232+-CVE-Id: CVE-2023-25139
3333+-Public-Date: 2023-02-02
3434+-Vulnerable-Commit: e88b9f0e5cc50cab57a299dc7efe1a4eb385161d (2.37)
3535+-Fix-Commit: c980549cc6a1c03c23cc2fe3e7b0fe626a0364b0 (2.38)
3636+-Fix-Commit: 07b9521fc6369d000216b96562ff7c0ed32a16c4 (2.37-4)
3737+diff --git a/advisories/GLIBC-SA-2023-0002 b/advisories/GLIBC-SA-2023-0002
3838+deleted file mode 100644
3939+index 5122669a64..0000000000
4040+--- a/advisories/GLIBC-SA-2023-0002
4141++++ /dev/null
4242+@@ -1,15 +0,0 @@
4343+-getaddrinfo: Stack read overflow in no-aaaa mode
4444+-
4545+-If the system is configured in no-aaaa mode via /etc/resolv.conf,
4646+-getaddrinfo is called for the AF_UNSPEC address family, and a DNS
4747+-response is received over TCP that is larger than 2048 bytes,
4848+-getaddrinfo may potentially disclose stack contents via the returned
4949+-address data, or crash.
5050+-
5151+-CVE-Id: CVE-2023-4527
5252+-Public-Date: 2023-09-12
5353+-Vulnerable-Commit: f282cdbe7f436c75864e5640a409a10485e9abb2 (2.36)
5454+-Fix-Commit: bd77dd7e73e3530203be1c52c8a29d08270cb25d (2.39)
5555+-Fix-Commit: 4ea972b7edd7e36610e8cde18bf7a8149d7bac4f (2.36-113)
5656+-Fix-Commit: b7529346025a130fee483d42178b5c118da971bb (2.37-38)
5757+-Fix-Commit: b25508dd774b617f99419bdc3cf2ace4560cd2d6 (2.38-19)
5858+diff --git a/advisories/GLIBC-SA-2023-0003 b/advisories/GLIBC-SA-2023-0003
5959+deleted file mode 100644
6060+index d3aef80348..0000000000
6161+--- a/advisories/GLIBC-SA-2023-0003
6262++++ /dev/null
6363+@@ -1,15 +0,0 @@
6464+-getaddrinfo: Potential use-after-free
6565+-
6666+-When an NSS plugin only implements the _gethostbyname2_r and
6767+-_getcanonname_r callbacks, getaddrinfo could use memory that was freed
6868+-during buffer resizing, potentially causing a crash or read or write to
6969+-arbitrary memory.
7070+-
7171+-CVE-Id: CVE-2023-4806
7272+-Public-Date: 2023-09-12
7373+-Fix-Commit: 973fe93a5675c42798b2161c6f29c01b0e243994 (2.39)
7474+-Fix-Commit: e09ee267c03e3150c2c9ba28625ab130705a485e (2.34-420)
7575+-Fix-Commit: e3ccb230a961b4797510e6a1f5f21fd9021853e7 (2.35-270)
7676+-Fix-Commit: a9728f798ec7f05454c95637ee6581afaa9b487d (2.36-115)
7777+-Fix-Commit: 6529a7466c935f36e9006b854d6f4e1d4876f942 (2.37-39)
7878+-Fix-Commit: 00ae4f10b504bc4564e9f22f00907093f1ab9338 (2.38-20)
7979+diff --git a/advisories/GLIBC-SA-2023-0004 b/advisories/GLIBC-SA-2023-0004
8080+deleted file mode 100644
8181+index 5286a7aa54..0000000000
8282+--- a/advisories/GLIBC-SA-2023-0004
8383++++ /dev/null
8484+@@ -1,16 +0,0 @@
8585+-tunables: local privilege escalation through buffer overflow
8686+-
8787+-If a tunable of the form NAME=NAME=VAL is passed in the environment of a
8888+-setuid program and NAME is valid, it may result in a buffer overflow,
8989+-which could be exploited to achieve escalated privileges. This flaw was
9090+-introduced in glibc 2.34.
9191+-
9292+-CVE-Id: CVE-2023-4911
9393+-Public-Date: 2023-10-03
9494+-Vulnerable-Commit: 2ed18c5b534d9e92fc006202a5af0df6b72e7aca (2.34)
9595+-Fix-Commit: 1056e5b4c3f2d90ed2b4a55f96add28da2f4c8fa (2.39)
9696+-Fix-Commit: dcc367f148bc92e7f3778a125f7a416b093964d9 (2.34-423)
9797+-Fix-Commit: c84018a05aec80f5ee6f682db0da1130b0196aef (2.35-274)
9898+-Fix-Commit: 22955ad85186ee05834e47e665056148ca07699c (2.36-118)
9999+-Fix-Commit: b4e23c75aea756b4bddc4abcf27a1c6dca8b6bd3 (2.37-45)
100100+-Fix-Commit: 750a45a783906a19591fb8ff6b7841470f1f5701 (2.38-27)
101101+diff --git a/advisories/GLIBC-SA-2023-0005 b/advisories/GLIBC-SA-2023-0005
102102+deleted file mode 100644
103103+index cc4eb90b82..0000000000
104104+--- a/advisories/GLIBC-SA-2023-0005
105105++++ /dev/null
106106+@@ -1,18 +0,0 @@
107107+-getaddrinfo: DoS due to memory leak
108108+-
109109+-The fix for CVE-2023-4806 introduced a memory leak when an application
110110+-calls getaddrinfo for AF_INET6 with AI_CANONNAME, AI_ALL and AI_V4MAPPED
111111+-flags set.
112112+-
113113+-CVE-Id: CVE-2023-5156
114114+-Public-Date: 2023-09-25
115115+-Vulnerable-Commit: e09ee267c03e3150c2c9ba28625ab130705a485e (2.34-420)
116116+-Vulnerable-Commit: e3ccb230a961b4797510e6a1f5f21fd9021853e7 (2.35-270)
117117+-Vulnerable-Commit: a9728f798ec7f05454c95637ee6581afaa9b487d (2.36-115)
118118+-Vulnerable-Commit: 6529a7466c935f36e9006b854d6f4e1d4876f942 (2.37-39)
119119+-Vulnerable-Commit: 00ae4f10b504bc4564e9f22f00907093f1ab9338 (2.38-20)
120120+-Fix-Commit: 8006457ab7e1cd556b919f477348a96fe88f2e49 (2.34-421)
121121+-Fix-Commit: 17092c0311f954e6f3c010f73ce3a78c24ac279a (2.35-272)
122122+-Fix-Commit: 856bac55f98dc840e7c27cfa82262b933385de90 (2.36-116)
123123+-Fix-Commit: 4473d1b87d04b25cdd0e0354814eeaa421328268 (2.37-42)
124124+-Fix-Commit: 5ee59ca371b99984232d7584fe2b1a758b4421d3 (2.38-24)
125125+diff --git a/advisories/GLIBC-SA-2024-0001 b/advisories/GLIBC-SA-2024-0001
126126+deleted file mode 100644
127127+index 28931c75ae..0000000000
128128+--- a/advisories/GLIBC-SA-2024-0001
129129++++ /dev/null
130130+@@ -1,15 +0,0 @@
131131+-syslog: Heap buffer overflow in __vsyslog_internal
132132+-
133133+-__vsyslog_internal did not handle a case where printing a SYSLOG_HEADER
134134+-containing a long program name failed to update the required buffer
135135+-size, leading to the allocation and overflow of a too-small buffer on
136136+-the heap.
137137+-
138138+-CVE-Id: CVE-2023-6246
139139+-Public-Date: 2024-01-30
140140+-Vulnerable-Commit: 52a5be0df411ef3ff45c10c7c308cb92993d15b1 (2.37)
141141+-Fix-Commit: 6bd0e4efcc78f3c0115e5ea9739a1642807450da (2.39)
142142+-Fix-Commit: 23514c72b780f3da097ecf33a793b7ba9c2070d2 (2.38-42)
143143+-Fix-Commit: 97a4292aa4a2642e251472b878d0ec4c46a0e59a (2.37-57)
144144+-Vulnerable-Commit: b0e7888d1fa2dbd2d9e1645ec8c796abf78880b9 (2.36-16)
145145+-Fix-Commit: d1a83b6767f68b3cb5b4b4ea2617254acd040c82 (2.36-126)
146146+diff --git a/advisories/GLIBC-SA-2024-0002 b/advisories/GLIBC-SA-2024-0002
147147+deleted file mode 100644
148148+index 940bfcf2fc..0000000000
149149+--- a/advisories/GLIBC-SA-2024-0002
150150++++ /dev/null
151151+@@ -1,15 +0,0 @@
152152+-syslog: Heap buffer overflow in __vsyslog_internal
153153+-
154154+-__vsyslog_internal used the return value of snprintf/vsnprintf to
155155+-calculate buffer sizes for memory allocation. If these functions (for
156156+-any reason) failed and returned -1, the resulting buffer would be too
157157+-small to hold output.
158158+-
159159+-CVE-Id: CVE-2023-6779
160160+-Public-Date: 2024-01-30
161161+-Vulnerable-Commit: 52a5be0df411ef3ff45c10c7c308cb92993d15b1 (2.37)
162162+-Fix-Commit: 7e5a0c286da33159d47d0122007aac016f3e02cd (2.39)
163163+-Fix-Commit: d0338312aace5bbfef85e03055e1212dd0e49578 (2.38-43)
164164+-Fix-Commit: 67062eccd9a65d7fda9976a56aeaaf6c25a80214 (2.37-58)
165165+-Vulnerable-Commit: b0e7888d1fa2dbd2d9e1645ec8c796abf78880b9 (2.36-16)
166166+-Fix-Commit: 2bc9d7c002bdac38b5c2a3f11b78e309d7765b83 (2.36-127)
167167+diff --git a/advisories/GLIBC-SA-2024-0003 b/advisories/GLIBC-SA-2024-0003
168168+deleted file mode 100644
169169+index b43a5150ab..0000000000
170170+--- a/advisories/GLIBC-SA-2024-0003
171171++++ /dev/null
172172+@@ -1,13 +0,0 @@
173173+-syslog: Integer overflow in __vsyslog_internal
174174+-
175175+-__vsyslog_internal calculated a buffer size by adding two integers, but
176176+-did not first check if the addition would overflow.
177177+-
178178+-CVE-Id: CVE-2023-6780
179179+-Public-Date: 2024-01-30
180180+-Vulnerable-Commit: 52a5be0df411ef3ff45c10c7c308cb92993d15b1 (2.37)
181181+-Fix-Commit: ddf542da94caf97ff43cc2875c88749880b7259b (2.39)
182182+-Fix-Commit: d37c2b20a4787463d192b32041c3406c2bd91de0 (2.38-44)
183183+-Fix-Commit: 2b58cba076e912961ceaa5fa58588e4b10f791c0 (2.37-59)
184184+-Vulnerable-Commit: b0e7888d1fa2dbd2d9e1645ec8c796abf78880b9 (2.36-16)
185185+-Fix-Commit: b9b7d6a27aa0632f334352fa400771115b3c69b7 (2.36-128)
186186+diff --git a/advisories/README b/advisories/README
187187+deleted file mode 100644
188188+index 94e68b1350..0000000000
189189+--- a/advisories/README
190190++++ /dev/null
191191+@@ -1,73 +0,0 @@
192192+-GNU C Library Security Advisory Format
193193+-======================================
194194+-
195195+-Security advisories in this directory follow a simple git commit log
196196+-format, with a heading and free-format description augmented with tags
197197+-to allow parsing key information. References to code changes are
198198+-specific to the glibc repository and follow a specific format:
199199+-
200200+- Tag-name: <commit-ref> (release-version)
201201+-
202202+-The <commit-ref> indicates a specific commit in the repository. The
203203+-release-version indicates the publicly consumable release in which this
204204+-commit is known to exist. The release-version is derived from the
205205+-git-describe format, (i.e. stripped out from glibc-2.34.NNN-gxxxx) and
206206+-is of the form 2.34-NNN. If the -NNN suffix is absent, it means that
207207+-the change is in that release tarball, otherwise the change is on the
208208+-release/2.YY/master branch and not in any released tarball.
209209+-
210210+-The following tags are currently being used:
211211+-
212212+-CVE-Id:
213213+-This is the CVE-Id assigned under the CVE Program
214214+-(https://www.cve.org/).
215215+-
216216+-Public-Date:
217217+-The date this issue became publicly known.
218218+-
219219+-Vulnerable-Commit:
220220+-The commit that introduced this vulnerability. There could be multiple
221221+-entries, one for each release branch in the glibc repository; the
222222+-release-version portion of this tag should tell you which branch this is
223223+-on.
224224+-
225225+-Fix-Commit:
226226+-The commit that fixed this vulnerability. There could be multiple
227227+-entries for each release branch in the glibc repository, indicating that
228228+-all of those commits contributed to fixing that issue in each of those
229229+-branches.
230230+-
231231+-Adding an Advisory
232232+-------------------
233233+-
234234+-An advisory for a CVE needs to be added on the master branch in two steps:
235235+-
236236+-1. Add the text of the advisory without any Fix-Commit tags along with
237237+- the fix for the CVE. Add the Vulnerable-Commit tag, if applicable.
238238+- The advisories directory does not exist in release branches, so keep
239239+- the advisory text commit distinct from the code changes, to ease
240240+- backports. Ask for the GLIBC-SA advisory number from the security
241241+- team.
242242+-
243243+-2. Finish all backports on release branches and then back on the msater
244244+- branch, add all commit refs to the advisory using the Fix-Commit
245245+- tags. Don't bother adding the release-version subscript since the
246246+- next step will overwrite it.
247247+-
248248+-3. Run the process-advisories.sh script in the scripts directory on the
249249+- advisory:
250250+-
251251+- scripts/process-advisories.sh update GLIBC-SA-YYYY-NNNN
252252+-
253253+- (replace YYYY-NNNN with the actual advisory number).
254254+-
255255+-4. Verify the updated advisory and push the result.
256256+-
257257+-Getting a NEWS snippet from advisories
258258+---------------------------------------
259259+-
260260+-Run:
261261+-
262262+- scripts/process-advisories.sh news
263263+-
264264+-and copy the content into the NEWS file.
265265+266266+commit 63295e4fda1f6dab4bf7442706fe303bf283036c
267267+Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
268268+Date: Mon Feb 5 16:10:24 2024 +0000
269269+270270+ arm: Remove wrong ldr from _dl_start_user (BZ 31339)
271271+272272+ The commit 49d877a80b29d3002887b084eec6676d9f5fec18 (arm: Remove
273273+ _dl_skip_args usage) removed the _SKIP_ARGS literal, which was
274274+ previously loader to r4 on loader _start. However, the cleanup did not
275275+ remove the following 'ldr r4, [sl, r4]' on _dl_start_user, used to check
276276+ to skip the arguments after ld self-relocations.
277277+278278+ In my testing, the kernel initially set r4 to 0, which makes the
279279+ ldr instruction just read the _GLOBAL_OFFSET_TABLE_. However, since r4
280280+ is a callee-saved register; a different runtime might not zero
281281+ initialize it and thus trigger an invalid memory access.
282282+283283+ Checked on arm-linux-gnu.
284284+285285+ Reported-by: Adrian Ratiu <adrian.ratiu@collabora.com>
286286+ Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
287287+ (cherry picked from commit 1e25112dc0cb2515d27d8d178b1ecce778a9d37a)
288288+289289+diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
290290+index b857bbc868..dd1a0f6b6e 100644
291291+--- a/sysdeps/arm/dl-machine.h
292292++++ b/sysdeps/arm/dl-machine.h
293293+@@ -139,7 +139,6 @@ _start:\n\
294294+ _dl_start_user:\n\
295295+ adr r6, .L_GET_GOT\n\
296296+ add sl, sl, r6\n\
297297+- ldr r4, [sl, r4]\n\
298298+ @ save the entry point in another register\n\
299299+ mov r6, r0\n\
300300+ @ get the original arg count\n\
301301+302302+commit 312e159626b67fe11f39e83e222cf4348a3962f3
303303+Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
304304+Date: Thu Feb 1 14:29:53 2024 -0300
305305+306306+ mips: FIx clone3 implementation (BZ 31325)
307307+308308+ For o32 we need to setup a minimal stack frame to allow cprestore
309309+ on __thread_start_clone3 (which instruct the linker to save the
310310+ gp for PIC). Also, there is no guarantee by kABI that $8 will be
311311+ preserved after syscall execution, so we need to save it on the
312312+ provided stack.
313313+314314+ Checked on mipsel-linux-gnu.
315315+316316+ Reported-by: Khem Raj <raj.khem@gmail.com>
317317+ Tested-by: Khem Raj <raj.khem@gmail.com>
318318+ (cherry picked from commit bbd248ac0d75efdef8fe61ea69b1fb25fb95b6e7)
319319+320320+diff --git a/sysdeps/unix/sysv/linux/mips/clone3.S b/sysdeps/unix/sysv/linux/mips/clone3.S
321321+index e9fec2fa47..481b8ae963 100644
322322+--- a/sysdeps/unix/sysv/linux/mips/clone3.S
323323++++ b/sysdeps/unix/sysv/linux/mips/clone3.S
324324+@@ -37,11 +37,6 @@
325325+326326+ .text
327327+ .set nomips16
328328+-#if _MIPS_SIM == _ABIO32
329329+-# define EXTRA_LOCALS 1
330330+-#else
331331+-# define EXTRA_LOCALS 0
332332+-#endif
333333+ #define FRAMESZ ((NARGSAVE*SZREG)+ALSZ)&ALMASK
334334+ GPOFF= FRAMESZ-(1*SZREG)
335335+ NESTED(__clone3, SZREG, sp)
336336+@@ -68,8 +63,31 @@ NESTED(__clone3, SZREG, sp)
337337+ beqz a0, L(error) /* No NULL cl_args pointer. */
338338+ beqz a2, L(error) /* No NULL function pointer. */
339339+340340++#if _MIPS_SIM == _ABIO32
341341++ /* Both stack and stack_size on clone_args are defined as uint64_t, and
342342++ there is no need to handle values larger than to 32 bits for o32. */
343343++# if __BYTE_ORDER == __BIG_ENDIAN
344344++# define CL_STACKPOINTER_OFFSET 44
345345++# define CL_STACKSIZE_OFFSET 52
346346++# else
347347++# define CL_STACKPOINTER_OFFSET 40
348348++# define CL_STACKSIZE_OFFSET 48
349349++# endif
350350++
351351++ /* For o32 we need to setup a minimal stack frame to allow cprestore
352352++ on __thread_start_clone3. Also there is no guarantee by kABI that
353353++ $8 will be preserved after syscall execution (so we need to save it
354354++ on the provided stack). */
355355++ lw t0, CL_STACKPOINTER_OFFSET(a0) /* Load the stack pointer. */
356356++ lw t1, CL_STACKSIZE_OFFSET(a0) /* Load the stack_size. */
357357++ addiu t1, -32 /* Update the stack size. */
358358++ addu t2, t1, t0 /* Calculate the thread stack. */
359359++ sw a3, 0(t2) /* Save argument pointer. */
360360++ sw t1, CL_STACKSIZE_OFFSET(a0) /* Save the new stack size. */
361361++#else
362362+ move $8, a3 /* a3 is set to 0/1 for syscall success/error
363363+ while a4/$8 is returned unmodified. */
364364++#endif
365365+366366+ /* Do the system call, the kernel expects:
367367+ v0: system call number
368368+@@ -125,7 +143,11 @@ L(thread_start_clone3):
369369+370370+ /* Restore the arg for user's function. */
371371+ move t9, a2 /* Function pointer. */
372372++#if _MIPS_SIM == _ABIO32
373373++ PTR_L a0, 0(sp)
374374++#else
375375+ move a0, $8 /* Argument pointer. */
376376++#endif
377377+378378+ /* Call the user's function. */
379379+ jal t9
380380+381381+commit d0724994de40934c552f1f68de89053848a44927
382382+Author: Xi Ruoyao <xry111@xry111.site>
383383+Date: Thu Feb 22 21:26:55 2024 +0100
384384+385385+ math: Update mips64 ulps
386386+387387+ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
388388+ (cherry picked from commit e2a65ecc4b30a797df7dc6529f09b712aa256029)
389389+390390+diff --git a/sysdeps/mips/mips64/libm-test-ulps b/sysdeps/mips/mips64/libm-test-ulps
391391+index 78969745b2..933aba4735 100644
392392+--- a/sysdeps/mips/mips64/libm-test-ulps
393393++++ b/sysdeps/mips/mips64/libm-test-ulps
394394+@@ -1066,17 +1066,17 @@ double: 1
395395+ ldouble: 1
396396+397397+ Function: "j0":
398398+-double: 2
399399++double: 3
400400+ float: 9
401401+ ldouble: 2
402402+403403+ Function: "j0_downward":
404404+-double: 5
405405++double: 6
406406+ float: 9
407407+ ldouble: 9
408408+409409+ Function: "j0_towardzero":
410410+-double: 6
411411++double: 7
412412+ float: 9
413413+ ldouble: 9
414414+415415+@@ -1146,6 +1146,7 @@ float: 6
416416+ ldouble: 8
417417+418418+ Function: "log":
419419++double: 1
420420+ float: 1
421421+ ldouble: 1
422422+423423+424424+commit e0910f1d3278f05439fb434ee528fc9be1b6bd5e
425425+Author: Stefan Liebler <stli@linux.ibm.com>
426426+Date: Thu Feb 22 15:03:27 2024 +0100
427427+428428+ S390: Do not clobber r7 in clone [BZ #31402]
429429+430430+ Starting with commit e57d8fc97b90127de4ed3e3a9cdf663667580935
431431+ "S390: Always use svc 0"
432432+ clone clobbers the call-saved register r7 in error case:
433433+ function or stack is NULL.
434434+435435+ This patch restores the saved registers also in the error case.
436436+ Furthermore the existing test misc/tst-clone is extended to check
437437+ all error cases and that clone does not clobber registers in this
438438+ error case.
439439+440440+ (cherry picked from commit 02782fd12849b6673cb5c2728cb750e8ec295aa3)
441441+442442+diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
443443+index 4c882ef2ee..a7a863242c 100644
444444+--- a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
445445++++ b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
446446+@@ -53,6 +53,7 @@ ENTRY(__clone)
447447+ br %r14
448448+ error:
449449+ lhi %r2,-EINVAL
450450++ lm %r6,%r7,24(%r15) /* Load registers. */
451451+ j SYSCALL_ERROR_LABEL
452452+ PSEUDO_END (__clone)
453453+454454+diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
455455+index 4eb104be71..c552a6b8de 100644
456456+--- a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
457457++++ b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
458458+@@ -54,6 +54,7 @@ ENTRY(__clone)
459459+ br %r14
460460+ error:
461461+ lghi %r2,-EINVAL
462462++ lmg %r6,%r7,48(%r15) /* Restore registers. */
463463+ jg SYSCALL_ERROR_LABEL
464464+ PSEUDO_END (__clone)
465465+466466+diff --git a/sysdeps/unix/sysv/linux/tst-clone.c b/sysdeps/unix/sysv/linux/tst-clone.c
467467+index 470676ab2b..2bc7124983 100644
468468+--- a/sysdeps/unix/sysv/linux/tst-clone.c
469469++++ b/sysdeps/unix/sysv/linux/tst-clone.c
470470+@@ -16,12 +16,16 @@
471471+ License along with the GNU C Library; if not, see
472472+ <https://www.gnu.org/licenses/>. */
473473+474474+-/* BZ #2386 */
475475++/* BZ #2386, BZ #31402 */
476476+ #include <errno.h>
477477+ #include <stdio.h>
478478+ #include <stdlib.h>
479479+ #include <unistd.h>
480480+ #include <sched.h>
481481++#include <stackinfo.h> /* For _STACK_GROWS_{UP,DOWN}. */
482482++#include <support/check.h>
483483++
484484++volatile unsigned v = 0xdeadbeef;
485485+486486+ int child_fn(void *arg)
487487+ {
488488+@@ -30,22 +34,67 @@ int child_fn(void *arg)
489489+ }
490490+491491+ static int
492492+-do_test (void)
493493++__attribute__((noinline))
494494++do_clone (int (*fn)(void *), void *stack)
495495+ {
496496+ int result;
497497++ unsigned int a = v;
498498++ unsigned int b = v;
499499++ unsigned int c = v;
500500++ unsigned int d = v;
501501++ unsigned int e = v;
502502++ unsigned int f = v;
503503++ unsigned int g = v;
504504++ unsigned int h = v;
505505++ unsigned int i = v;
506506++ unsigned int j = v;
507507++ unsigned int k = v;
508508++ unsigned int l = v;
509509++ unsigned int m = v;
510510++ unsigned int n = v;
511511++ unsigned int o = v;
512512++
513513++ result = clone (fn, stack, 0, NULL);
514514++
515515++ /* Check that clone does not clobber call-saved registers. */
516516++ TEST_VERIFY (a == v && b == v && c == v && d == v && e == v && f == v
517517++ && g == v && h == v && i == v && j == v && k == v && l == v
518518++ && m == v && n == v && o == v);
519519++
520520++ return result;
521521++}
522522++
523523++static void
524524++__attribute__((noinline))
525525++do_test_single (int (*fn)(void *), void *stack)
526526++{
527527++ printf ("%s (fn=%p, stack=%p)\n", __FUNCTION__, fn, stack);
528528++ errno = 0;
529529++
530530++ int result = do_clone (fn, stack);
531531++
532532++ TEST_COMPARE (errno, EINVAL);
533533++ TEST_COMPARE (result, -1);
534534++}
535535+536536+- result = clone (child_fn, NULL, 0, NULL);
537537++static int
538538++do_test (void)
539539++{
540540++ char st[128 * 1024] __attribute__ ((aligned));
541541++ void *stack = NULL;
542542++#if _STACK_GROWS_DOWN
543543++ stack = st + sizeof (st);
544544++#elif _STACK_GROWS_UP
545545++ stack = st;
546546++#else
547547++# error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
548548++#endif
549549+550550+- if (errno != EINVAL || result != -1)
551551+- {
552552+- printf ("FAIL: clone()=%d (wanted -1) errno=%d (wanted %d)\n",
553553+- result, errno, EINVAL);
554554+- return 1;
555555+- }
556556++ do_test_single (child_fn, NULL);
557557++ do_test_single (NULL, stack);
558558++ do_test_single (NULL, NULL);
559559+560560+- puts ("All OK");
561561+ return 0;
562562+ }
563563+564564+-#define TEST_FUNCTION do_test ()
565565+-#include "../test-skeleton.c"
566566++#include <support/test-driver.c>
+9-16
pkgs/development/libraries/glibc/common.nix
···3636, withLinuxHeaders ? false
3737, profilingLibraries ? false
3838, withGd ? false
3939-, withLibcrypt ? false
4039, extraBuildInputs ? []
4140, extraNativeBuildInputs ? []
4241, ...
4342} @ args:
44434544let
4646- version = "2.38";
4747- patchSuffix = "-44";
4848- sha256 = "sha256-+4KZiZiyspllRnvBtp0VLpwwfSzzAcnq+0VVt3DvP9I=";
4545+ version = "2.39";
4646+ patchSuffix = "-5";
4747+ sha256 = "sha256-93vUfPgXDFc2Wue/hmlsEYrbOxINMlnGTFAtPcHi2SY=";
4948in
50495150assert withLinuxHeaders -> linuxHeaders != null;
···5958 patches =
6059 [
6160 /* No tarballs for stable upstream branch, only https://sourceware.org/git/glibc.git and using git would complicate bootstrapping.
6262- $ git fetch --all -p && git checkout origin/release/2.38/master && git describe
6363- glibc-2.38-44-gd37c2b20a4
6464- $ git show --minimal --reverse glibc-2.38.. | gzip -9n --rsyncable - > 2.38-master.patch.gz
6161+ $ git fetch --all -p && git checkout origin/release/2.39/master && git describe
6262+ glibc-2.39-5-ge0910f1d32
6363+ $ git show --minimal --reverse glibc-2.39.. > 2.39-master.patch
65646665 To compare the archive contents zdiff can be used.
6767- $ zdiff -u 2.38-master.patch.gz ../nixpkgs/pkgs/development/libraries/glibc/2.38-master.patch.gz
6666+ $ diff -u 2.39-master.patch ../nixpkgs/pkgs/development/libraries/glibc/2.39-master.patch
6867 */
6969- ./2.38-master.patch.gz
6868+ ./2.39-master.patch
70697170 /* Allow NixOS and Nix to handle the locale-archive. */
7271 ./nix-locale-archive.patch
···9695 & https://github.com/NixOS/nixpkgs/pull/188492#issuecomment-1233802991
9796 */
9897 ./reenable_DT_HASH.patch
9999-100100- /* Retrieved from https://salsa.debian.org/glibc-team/glibc/-/commit/662dbc4f9287139a0d9c91df328a5ba6cc6abee1#0f3c6d67cb8cf5bb35c421c20f828fea97b68edf
101101- Qualys advisory: https://www.qualys.com/2024/01/30/qsort.txt
102102- */
103103- ./local-qsort-memory-corruption.patch
10498 ]
10599 /* NVCC does not support ARM intrinsics. Since <math.h> is pulled in by almost
106100 every HPC piece of software, without this patch CUDA compilation on ARM
···177171 # so the glibc does not depend on its compiler store path
178172 "libc_cv_as_needed=no"
179173 ]
180180- ++ lib.optional withGd "--with-gd"
181181- ++ lib.optional withLibcrypt "--enable-crypt";
174174+ ++ lib.optional withGd "--with-gd";
182175183176 makeFlags = (args.makeFlags or []) ++ [
184177 "OBJCOPY=${stdenv.cc.targetPrefix}objcopy"