[AutoPR- Security] Patch binutils for CVE-2025-8225 [MEDIUM]#14406
Conversation
Signed-off-by: Kanishk Bansal <kanbansal@microsoft.com>
|
@Sumynwa, gentle reminder for your review and approval! |
SPECS/binutils/CVE-2025-8224.patch
Outdated
| +++ 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 |
There was a problem hiding this comment.
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.
8a04ef8 to
baffd9a
Compare
baffd9a to
f73221d
Compare
|
Re Full Build |
|
Full Build passed |
|
@Sumynwa. could you please share your review and signoff on this PR? |
|
Signing off Patch changes. Upstream Patch: Backported: YES Toolchain Packages: YES FULL Build RUN: YES, Pass |
SPECS/binutils/CVE-2025-8224.patch
Outdated
| - /* 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
There were few other follow-ups, one with segv, please check once: https://sourceware.org/bugzilla/show_bug.cgi?id=32109 |
sandeepkarambelkar
left a comment
There was a problem hiding this comment.
Patch applied cleanly in the BB
Full Build Successful, no issues found in the toolchain
Changes LGTM
kgodara912
left a comment
There was a problem hiding this comment.
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.
…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>


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)
*-staticsubpackages, etc.) have had theirReleasetag incremented../cgmanifest.json,./toolkit/scripts/toolchain/cgmanifest.json,.github/workflows/cgmanifest.json)./LICENSES-AND-NOTICES/SPECS/data/licenses.json,./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md,./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)*.signatures.jsonfilessudo make go-tidy-allandsudo make go-test-coveragepassSummary
What does the PR accomplish, why was it needed?
Change Log
Does this affect the toolchain?
YES
Associated issues
Links to CVEs
Test Methodology