From 1ec7b5603eab6b4786d36a729340a7971b83e819 Mon Sep 17 00:00:00 2001 From: Qingqing Li Date: Wed, 21 May 2025 15:47:12 +0800 Subject: [PATCH] elf: Fix subprocess status handling for tst-dlopen-sgid (bug 32987) (cherry picked from commit 85c24a87c2b368e2fcf53a162330af73d74b2bbb) --- ...ss-status-handling-for-tst-dlopen-sg.patch | 62 +++++++++++++++++++ glibc.spec | 6 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 elf-Fix-subprocess-status-handling-for-tst-dlopen-sg.patch diff --git a/elf-Fix-subprocess-status-handling-for-tst-dlopen-sg.patch b/elf-Fix-subprocess-status-handling-for-tst-dlopen-sg.patch new file mode 100644 index 0000000..d3b034b --- /dev/null +++ b/elf-Fix-subprocess-status-handling-for-tst-dlopen-sg.patch @@ -0,0 +1,62 @@ +From ca7e32d024fa7cc214a51213703f49703e1ab921 Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Wed, 21 May 2025 08:43:32 +0200 +Subject: [PATCH] elf: Fix subprocess status handling for tst-dlopen-sgid (bug + 32987) + +This should really move into support_capture_subprogram_self_sgid. + +Reviewed-by: Sam James +(cherry picked from commit 35fc356fa3b4f485bd3ba3114c9f774e5df7d3c2) +--- + NEWS | 1 + + elf/tst-dlopen-sgid.c | 12 ++++++++++-- + 2 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/NEWS b/NEWS +index 3e511d6de4..f18319f003 100644 +--- a/NEWS ++++ b/NEWS +@@ -67,6 +67,7 @@ The following bugs are resolved with this release: + [32231] elf: Change ldconfig auxcache magic number + [32470] x86: Avoid integer truncation with large cache sizes + [32582] Fix underallocation of abort_msg_s struct (CVE-2025-0395) ++ [32987] elf: Fix subprocess status handling for tst-dlopen-sgid + + Version 2.38 + +diff --git a/elf/tst-dlopen-sgid.c b/elf/tst-dlopen-sgid.c +index 47829a405e..5688b79f2e 100644 +--- a/elf/tst-dlopen-sgid.c ++++ b/elf/tst-dlopen-sgid.c +@@ -26,6 +26,8 @@ + #include + #include + #include ++#include ++#include + #include + + /* This is the name of our test object. Use a custom module for +@@ -66,10 +68,16 @@ do_test (void) + free (from); + } + +- TEST_COMPARE (support_capture_subprogram_self_sgid (magic_argument), 0); +- + free (libdir); + ++ int status = support_capture_subprogram_self_sgid (magic_argument); ++ ++ if (WEXITSTATUS (status) == EXIT_UNSUPPORTED) ++ return EXIT_UNSUPPORTED; ++ ++ if (!WIFEXITED (status)) ++ FAIL_EXIT1 ("Unexpected exit status %d from child process\n", status); ++ + return 0; + } + +-- +2.27.0 + diff --git a/glibc.spec b/glibc.spec index 0db7a1e..e3fe786 100644 --- a/glibc.spec +++ b/glibc.spec @@ -67,7 +67,7 @@ ############################################################################## Name: glibc Version: 2.38 -Release: 58 +Release: 59 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -291,6 +291,7 @@ Patch201: support-Use-const-char-argument-in-support_capture_s.patch Patch202: support-Add-support_record_failure_barrier.patch Patch203: elf-Test-case-for-bug-32976-CVE-2025-4802.patch Patch204: x86_64-Fix-typo-in-ifunc-impl-list.c.patch +Patch205: elf-Fix-subprocess-status-handling-for-tst-dlopen-sg.patch #openEuler patch list Patch9000: turn-default-value-of-x86_rep_stosb_threshold_form_2K_to_1M.patch @@ -1515,6 +1516,9 @@ fi %endif %changelog +* Wed May 21 2025 Qingqing Li - 2.38-59 +- elf: Fix subprocess status handling for tst-dlopen-sgid (bug 32987) + * Wed May 21 2025 Qingqing Li - 2.38-58 - x86_64: Fix typo in ifunc-impl-list.c. - elf: Test case for bug 32976 (CVE-2025-4802) -- Gitee