Skip to content

[AutoPR- Security] Patch binutils for CVE-2025-8225 [MEDIUM]#14406

Merged
kgodara912 merged 5 commits intomicrosoft:3.0-devfrom
azurelinux-security:azure-autosec/binutils/3.0/883259
Sep 19, 2025
Merged

[AutoPR- Security] Patch binutils for CVE-2025-8225 [MEDIUM]#14406
kgodara912 merged 5 commits intomicrosoft:3.0-devfrom
azurelinux-security:azure-autosec/binutils/3.0/883259

Conversation

@azurelinux-security
Copy link
Contributor

@azurelinux-security azurelinux-security commented Jul 28, 2025

Auto Patch binutils for CVE-2025-8225

Autosec pipeline run -> https://dev.azure.com/mariner-org/mariner-chatbot/_build/results?buildId=883259&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

Associated issues
  • N/A
Links to CVEs
Test Methodology

@microsoft-github-policy-service microsoft-github-policy-service bot added Packaging 3.0-dev PRs Destined for AzureLinux 3.0 labels Jul 28, 2025
@Kanishk-Bansal Kanishk-Bansal marked this pull request as ready for review July 28, 2025 19:44
@Kanishk-Bansal Kanishk-Bansal requested a review from a team as a code owner July 28, 2025 19:44
Signed-off-by: Kanishk Bansal <kanbansal@microsoft.com>
@Malateshk007 Malateshk007 requested a review from Sumynwa July 29, 2025 07:56
@Malateshk007
Copy link

@Sumynwa, gentle reminder for your review and approval!

+++ b/bfd/elf.c
@@ -287,7 +287,7 @@ bfd_elf_get_str_section (bfd *abfd, unsigned int shindex)

/* Allocate and clear an extra byte at the end, to prevent crashes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the upstream patch, update patch to also remove the stale comments:
Reference
* elf.c (bfd_elf_get_str_section): Remove outdated comment, and tweak shstrtabsize test to suit.

@Sumynwa
Copy link
Contributor

Sumynwa commented Aug 11, 2025

Full Build

@Kanishk-Bansal
Copy link
Contributor

Full Build

@jykanase jykanase force-pushed the azure-autosec/binutils/3.0/883259 branch from 8a04ef8 to baffd9a Compare August 12, 2025 11:49
@jykanase jykanase force-pushed the azure-autosec/binutils/3.0/883259 branch from baffd9a to f73221d Compare August 12, 2025 11:58
@Kanishk-Bansal
Copy link
Contributor

Re Full Build

@Kanishk-Bansal
Copy link
Contributor

Full Build passed

@Malateshk007
Copy link

@Sumynwa. could you please share your review and signoff on this PR?

@Sumynwa
Copy link
Contributor

Sumynwa commented Aug 22, 2025

Signing off Patch changes.

Upstream Patch:
CVE-2025-8224
CVE-2025-8225

Backported: YES
CVE-2025-8224 Patch is backported.

Toolchain Packages: YES

FULL Build RUN: YES, Pass

Patch Applies Cleanly
X86_64
image

Arm64
image

- /* Allocate and clear an extra byte at the end, to prevent crashes
- in case the string table is not terminated. */
- if (shstrtabsize + 1 <= 1
+ if (shstrtabsize == 0
Copy link
Contributor

@kgodara912 kgodara912 Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to fix the CVE because this condition was same previously as well, for the unsigned integer shstrtabsize, the only value which makes above condition true is 0. (0 + 1 <= 1). All the other values will be positive and +1 will always be > 1 so it will go to same path. From the upstream reference,

Since bfd_section for .strtab isn't set, print the section index
instead.  Also, don't return NULL on this error as that results in
multiple mmap/read of the string table.
(We could return NULL if we
arranged to set sh_size zero first, but just what we do with fuzzed
object files is of no concern, and terminating the table might make a
faulty object file usable.)

The upstream reference has return NULL,

-           (_("%pB(%pA): string table is corrupt"),
-            abfd, i_shdrp[shindex]->bfd_section);
-         return NULL;
+           (_("%pB: string table [%u] is corrupt"), abfd, shindex);
+         shstrtab[shstrtabsize - 1] = 0;

And one extra condition is there. As per the description, that removal of return NULL should be preventing the extra reads. @Sumynwa, could you please check once, may be my observation is not correct.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree to what @kgodara912 is saying The actual fix is not returning NULL. However if we don't have the code causing the crash, we can actually dispute the CVE. Based on the CVE description, it is found in 2.44 version and we are at 2.41. We need to verify all the impacted code and if its not present, dispute this.

@Kanishk-Bansal
Copy link
Contributor

Buddy Build

@kgodara912
Copy link
Contributor

There were few other follow-ups, one with segv, please check once: https://sourceware.org/bugzilla/show_bug.cgi?id=32109

@Kanishk-Bansal Kanishk-Bansal marked this pull request as draft September 11, 2025 04:21
@Kanishk-Bansal Kanishk-Bansal changed the title [AutoPR- Security] Patch binutils for CVE-2025-8225, CVE-2025-8224 [MEDIUM] [AutoPR- Security] Patch binutils for CVE-2025-8225 [MEDIUM] Sep 11, 2025
@Kanishk-Bansal Kanishk-Bansal marked this pull request as ready for review September 13, 2025 12:37
@Kanishk-Bansal
Copy link
Contributor

Buddy Build

@Kanishk-Bansal
Copy link
Contributor

Full Build

Copy link
Contributor

@sandeepkarambelkar sandeepkarambelkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch applied cleanly in the BB
Full Build Successful, no issues found in the toolchain
Changes LGTM

Copy link
Contributor

@kgodara912 kgodara912 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch matches with upstream reference; buddy build is successful. Full build has one failure in container golden build which looks unrelated to this PR. LGTM.

@kgodara912 kgodara912 merged commit b6972e1 into microsoft:3.0-dev Sep 19, 2025
17 checks passed
jykanase added a commit to jykanase/azurelinux that referenced this pull request Oct 16, 2025
…ft#14406)

Signed-off-by: Kanishk Bansal <kanbansal@microsoft.com>
Co-authored-by: Kanishk Bansal <kanbansal@microsoft.com>
Co-authored-by: jykanase <v-jykanase@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants