Skip to content

[AutoPR- Security] Patch gdb for CVE-2025-11083 [LOW]#17030

Draft
azurelinux-security wants to merge 1 commit intomicrosoft:3.0-devfrom
azurelinux-security:azure-autosec/gdb/3.0/1109620
Draft

[AutoPR- Security] Patch gdb for CVE-2025-11083 [LOW]#17030
azurelinux-security wants to merge 1 commit intomicrosoft:3.0-devfrom
azurelinux-security:azure-autosec/gdb/3.0/1109620

Conversation

@azurelinux-security
Copy link
Copy Markdown
Contributor

@azurelinux-security azurelinux-security commented May 5, 2026

Auto Patch gdb for CVE-2025-11083.

Autosec pipeline run -> https://dev.azure.com/mariner-org/mariner/_build/results?buildId=1109620&view=results

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./LICENSES-AND-NOTICES/SPECS/data/licenses.json, ./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md, ./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

What does the PR accomplish, why was it needed?

Change Log
Does this affect the toolchain?

YES/NO

Associated issues
  • N/A
Links to CVEs
Test Methodology

@azurelinux-security
Copy link
Copy Markdown
Contributor Author

🔒 CVE Patch Review: CVE-2025-11083

PR #17030 — [AutoPR- Security] Patch gdb for CVE-2025-11083 [LOW]
Package: gdb | Branch: 3.0-dev


Spec File Validation

Check Status Detail
Release bump Release bumped 7 → 8
Patch entry Patch entries added: ['CVE-2025-11083.patch'] (covers ['CVE-2025-11083'])
Patch application %autosetup found in full spec — patches applied automatically
Changelog Changelog entry looks good
Signatures No source tarball changes — signatures N/A
Manifests Not a toolchain PR — manifests N/A

Build Verification

  • Build status: ✅ PASSED
  • Artifact downloaded:
  • CVE applied during build:
  • Warnings (17):
    • L731: time="2026-05-05T13:06:54Z" level=debug msg="sframe-dump.c:161:7: warning: '__builtin___strncat_chk' output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]"
    • L874: time="2026-05-05T13:06:55Z" level=debug msg="egrep: warning: egrep is obsolescent; using grep -E"
    • L6584: time="2026-05-05T13:07:07Z" level=debug msg="configure: WARNING:"
    • L6807: time="2026-05-05T13:07:11Z" level=debug msg="egrep: warning: egrep is obsolescent; using grep -E"
    • L6808: time="2026-05-05T13:07:11Z" level=debug msg="configure: WARNING: libipt is missing or unusable; some features may be unavailable."
    • L7316: time="2026-05-05T13:07:12Z" level=debug msg="egrep: warning: egrep is obsolescent; using grep -E"
    • L7317: time="2026-05-05T13:07:12Z" level=debug msg="configure: WARNING: libipt is missing or unusable; some features may be unavailable."
    • L7603: time="2026-05-05T13:07:22Z" level=debug msg="egrep: warning: egrep is obsolescent; using grep -E"
    • L7610: time="2026-05-05T13:07:22Z" level=debug msg="configure: WARNING: libipt is missing or unusable; some features may be unavailable."
    • L7611: time="2026-05-05T13:07:22Z" level=debug msg="configure: WARNING: babeltrace is missing or unusable; GDB is unable to read CTF data."
    • … and 7 more

🤖 AI Build Log Analysis

  • Risk: high
  • Summary: The gdb 13.2-8.azl3 package rebuilt successfully and produced both runtime and debuginfo RPMs. The build applied a patch for CVE-2023-39128 with no visible hunk failures, compiled and installed cleanly, and completed packaging without fatal errors. However, there is no evidence in the log that a patch for the targeted CVE-2025-11083 was applied.
  • AI-detected warnings:
    • Multiple RPM macro warnings: 'Macro %azl_* needs whitespace before body' from macros.releaseversions (spec macro formatting noise).
    • Could not canonicalize hostname: non-fatal environment warning during rpmbuild.
    • libtool: install: warning: remember to run 'libtool --finish /usr/lib' (benign in RPM packaging context).
    • cpio: '... .tmp: Cannot stat: No such file or directory' during debuginfo extraction (non-fatal; transient temporary files).

🧪 Test Log Analysis

  • Test status: ❌ FAILED
  • Test errors (358):
    • L11246: time="2026-05-05T13:07:28Z" level=debug msg="Running selftest memory_error::ARC600."
    • L11247: time="2026-05-05T13:07:28Z" level=debug msg="Running selftest memory_error::ARC601."
    • L11248: time="2026-05-05T13:07:28Z" level=debug msg="Running selftest memory_error::ARC700."
    • L11249: time="2026-05-05T13:07:28Z" level=debug msg="Running selftest memory_error::ARCv2."
    • L11250: time="2026-05-05T13:07:28Z" level=debug msg="Running selftest memory_error::Loongarch32."
    • L11251: time="2026-05-05T13:07:28Z" level=debug msg="Running selftest memory_error::Loongarch64."
    • L11252: time="2026-05-05T13:07:28Z" level=debug msg="Running selftest memory_error::MSP430."
    • L11253: time="2026-05-05T13:07:28Z" level=debug msg="Running selftest memory_error::MSP430X."
    • L11254: time="2026-05-05T13:07:28Z" level=debug msg="Running selftest memory_error::MSP430x11x1."
    • L11255: time="2026-05-05T13:07:28Z" level=debug msg="Running selftest memory_error::MSP430x12."
    • … and 348 more
  • Test warnings (22):
    • L725: time="2026-05-05T13:06:37Z" level=debug msg="sframe-dump.c:161:7: warning: '__builtin___strncat_chk' output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]"
    • L864: time="2026-05-05T13:06:38Z" level=debug msg="egrep: warning: egrep is obsolescent; using grep -E"
    • L6582: time="2026-05-05T13:06:52Z" level=debug msg="configure: WARNING:"
    • L6933: time="2026-05-05T13:06:55Z" level=debug msg="egrep: warning: egrep is obsolescent; using grep -E"
    • L6934: time="2026-05-05T13:06:55Z" level=debug msg="configure: WARNING: libipt is missing or unusable; some features may be unavailable."
    • L7314: time="2026-05-05T13:06:56Z" level=debug msg="egrep: warning: egrep is obsolescent; using grep -E"
    • L7315: time="2026-05-05T13:06:56Z" level=debug msg="configure: WARNING: libipt is missing or unusable; some features may be unavailable."
    • L7873: time="2026-05-05T13:07:08Z" level=debug msg="egrep: warning: egrep is obsolescent; using grep -E"
    • L7874: time="2026-05-05T13:07:08Z" level=debug msg="configure: WARNING: libipt is missing or unusable; some features may be unavailable."
    • L7875: time="2026-05-05T13:07:08Z" level=debug msg="configure: WARNING: babeltrace is missing or unusable; GDB is unable to read CTF data."
🤖 AI Test Log Analysis
  • Risk: medium
  • Summary: The gdb package’s %check phase completed successfully with exit status 0. The test run executed the gdb.base/default.exp DejaGnu subset, reporting 258 expected passes and no failures. The libsframe tests reported 4 unsupported tests and no failures, while libctf produced no counts (likely no tests executed). There were no indications of regressions or crashes during testing. The log does not show any CVE-2025-11083-specific tests, and overall coverage appears limited to a smoke test.

Patch Analysis

  • Match type: backport
  • Risk assessment: low
  • Summary: The PR applies the same functional changes as the upstream patch, converting elf_swap_shdr_in to return bool, returning false for corrupt section headers when processing linker input, and updating elf_object_p to reject such cases. The only notable differences are context offsets and use of bfd_bread instead of bfd_read, consistent with an older or differing codebase. Overall, it is a faithful backport of the upstream fix.
Detailed analysis

Comparison of the hunks shows the PR mirrors the upstream logic changes in bfd/elfcode.h: (1) Change elf_swap_shdr_in from static void to static bool; (2) When a section extends past EOF, emit a warning and, if abfd->is_linker_input is set, return false to avoid matching a corrupt section header; (3) Add a return true at the end of elf_swap_shdr_in; (4) In elf_object_p, adjust both the initial index-0 section read and the subsequent loop over section headers to combine the read with the call to elf_swap_shdr_in and jump to got_no_match if either the read fails or elf_swap_shdr_in returns false. The PR differs only in using bfd_bread instead of bfd_read, which is a typical API difference between versions and is functionally equivalent in this context. Line numbers and index hashes differ due to basing on a different tree, but the semantic changes match upstream. No hunks appear to be missing. Given the minimal and targeted nature of the change, the risk of incompleteness or regression is low, provided abfd->is_linker_input exists in the target codebase (which it does in relevant BFD versions) and bool is available. The patch file is placed under SPECS/gdb as a downstream patch, which is consistent with packaging practices and does not affect the code equivalence.

Raw diff (upstream vs PR)
--- upstream
+++ pr
@@ -1,76 +1,79 @@
-From 9ca499644a21ceb3f946d1c179c38a83be084490 Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Thu, 18 Sep 2025 16:59:25 -0700
-Subject: [PATCH] elf: Don't match corrupt section header in linker input
-
-Don't swap in nor match corrupt section header in linker input to avoid
-linker crash later.
-
-	PR ld/33457
-	* elfcode.h (elf_swap_shdr_in): Changed to return bool.  Return
-	false for corrupt section header in linker input.
-	(elf_object_p): Reject if elf_swap_shdr_in returns false.
-
-Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
----
- bfd/elfcode.h | 14 +++++++++-----
- 1 file changed, 9 insertions(+), 5 deletions(-)
-
-diff --git a/bfd/elfcode.h b/bfd/elfcode.h
-index 9c65852e103..5224a1abee6 100644
---- a/bfd/elfcode.h
-+++ b/bfd/elfcode.h
-@@ -311,7 +311,7 @@ elf_swap_ehdr_out (bfd *abfd,
- /* Translate an ELF section header table entry in external format into an
-    ELF section header table entry in internal format.  */
- 
--static void
-+static bool
- elf_swap_shdr_in (bfd *abfd,
- 		  const Elf_External_Shdr *src,
- 		  Elf_Internal_Shdr *dst)
-@@ -341,6 +341,9 @@ elf_swap_shdr_in (bfd *abfd,
- 	{
- 	  _bfd_error_handler (_("warning: %pB has a section "
- 				"extending past end of file"), abfd);
-+	  /* PR ld/33457: Don't match corrupt section header.  */
-+	  if (abfd->is_linker_input)
-+	    return false;
- 	  abfd->read_only = 1;
- 	}
-     }
-@@ -350,6 +353,7 @@ elf_swap_shdr_in (bfd *abfd,
-   dst->sh_entsize = H_GET_WORD (abfd, src->sh_entsize);
-   dst->bfd_section = NULL;
-   dst->contents = NULL;
-+  return true;
- }
- 
- /* Translate an ELF section header table entry in internal format into an
-@@ -642,9 +646,9 @@ elf_object_p (bfd *abfd)
- 
-       /* Read the first section header at index 0, and convert to internal
- 	 form.  */
--      if (bfd_read (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr))
-+      if (bfd_read (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr)
-+	  || !elf_swap_shdr_in (abfd, &x_shdr, &i_shdr))
- 	goto got_no_match;
--      elf_swap_shdr_in (abfd, &x_shdr, &i_shdr);
- 
-       /* If the section count is zero, the actual count is in the first
- 	 section header.  */
-@@ -730,9 +734,9 @@ elf_object_p (bfd *abfd)
- 	 to internal form.  */
-       for (shindex = 1; shindex < i_ehdrp->e_shnum; shindex++)
- 	{
--	  if (bfd_read (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr))
-+	  if (bfd_read (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr)
-+	      || !elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex))
- 	    goto got_no_match;
--	  elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex);
- 
- 	  /* Sanity check sh_link and sh_info.  */
- 	  if (i_shdrp[shindex].sh_link >= num_sec)
--- 
-2.43.7
-
+diff --git a/SPECS/gdb/CVE-2025-11083.patch b/SPECS/gdb/CVE-2025-11083.patch
+new file mode 100644
+index 00000000000..6ef2788f14c
+--- /dev/null
++++ b/SPECS/gdb/CVE-2025-11083.patch
+@@ -0,0 +1,73 @@
++From b1f730e0c928112b9bb703295fdfbe00d1a1f20d Mon Sep 17 00:00:00 2001
++From: AllSpark <allspark@microsoft.com>
++Date: Tue, 5 May 2026 12:42:02 +0000
++Subject: [PATCH] bfd: elf: Don't match corrupt section header in linker input
++
++PR ld/33457
++* elfcode.h (elf_swap_shdr_in): Change to return bool. Return false for corrupt section header in linker input.
++(elf_object_p): Reject if elf_swap_shdr_in returns false.
++
++Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
++Upstream-reference: AI Backport of https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=9ca499644a21ceb3f946d1c179c38a83be084490
++---
++ bfd/elfcode.h | 14 +++++++++-----
++ 1 file changed, 9 insertions(+), 5 deletions(-)
++
++diff --git a/bfd/elfcode.h b/bfd/elfcode.h
++index 7a4de82..d19fd18 100644
++--- a/bfd/elfcode.h
+++++ b/bfd/elfcode.h
++@@ -298,7 +298,7 @@ elf_swap_ehdr_out (bfd *abfd,
++ /* Translate an ELF section header table entry in external format into an
++    ELF section header table entry in internal format.  */
++ 
++-static void
+++static bool
++ elf_swap_shdr_in (bfd *abfd,
++ 		  const Elf_External_Shdr *src,
++ 		  Elf_Internal_Shdr *dst)
++@@ -328,6 +328,9 @@ elf_swap_shdr_in (bfd *abfd,
++ 	{
++ 	  _bfd_error_handler (_("warning: %pB has a section "
++ 				"extending past end of file"), abfd);
+++	  /* PR ld/33457: Don't match corrupt section header.  */
+++	  if (abfd->is_linker_input)
+++	    return false;
++ 	  abfd->read_only = 1;
++ 	}
++     }
++@@ -337,6 +340,7 @@ elf_swap_shdr_in (bfd *abfd,
++   dst->sh_entsize = H_GET_WORD (abfd, src->sh_entsize);
++   dst->bfd_section = NULL;
++   dst->contents = NULL;
+++  return true;
++ }
++ 
++ /* Translate an ELF section header table entry in internal format into an
++@@ -629,9 +633,9 @@ elf_object_p (bfd *abfd)
++ 
++       /* Read the first section header at index 0, and convert to internal
++ 	 form.  */
++-      if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr))
+++      if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr)
+++	  || !elf_swap_shdr_in (abfd, &x_shdr, &i_shdr))
++ 	goto got_no_match;
++-      elf_swap_shdr_in (abfd, &x_shdr, &i_shdr);
++ 
++       /* If the section count is zero, the actual count is in the first
++ 	 section header.  */
++@@ -717,9 +721,9 @@ elf_object_p (bfd *abfd)
++ 	 to internal form.  */
++       for (shindex = 1; shindex < i_ehdrp->e_shnum; shindex++)
++ 	{
++-	  if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr))
+++	  if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr)
+++	      || !elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex))
++ 	    goto got_no_match;
++-	  elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex);
++ 
++ 	  /* Sanity check sh_link and sh_info.  */
++ 	  if (i_shdrp[shindex].sh_link >= num_sec)
++-- 
++2.45.4
++

Verdict

CHANGES REQUESTED — Please address the issues flagged above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants