diff mbox series

[scarthgap,1/3] binutils: Patch CVE-2026-91781

Message ID 20261118162153.25025-2-jaipaul.cheernam@est.tech
State New
Headers show
Series binutils CVE fixes for CVE-2026-91781, CVE-2026-91782 and CVE-2026-90828 for scarthgap | expand

Commit Message

Jaipaul Cheernam Nov. 18, 2026, 4:21 p.m. UTC
NVD[1] lists only 2.47, but PoC ([3], attachment 16881) reproduces the SEGV on 2.42 and 2.46 too.
So, backported fix from [2] to 2.42

References:
[1] https://nvd.nist.gov/vuln/detail/cve-2026-91781
[2] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7322e9bc30cb282575a701c307851fd3d66fee68
[3] https://sourceware.org/bugzilla/show_bug.cgi?id=34449

Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
 .../binutils/binutils-2.42.inc                |  1 +
 .../binutils/binutils/CVE-2026-91781.patch    | 36 +++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 meta/recipes-devtools/binutils/binutils/CVE-2026-91781.patch
diff mbox series

Patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.42.inc b/meta/recipes-devtools/binutils/binutils-2.42.inc
index 37dce2cb3e..7e91b7fe57 100644
--- a/meta/recipes-devtools/binutils/binutils-2.42.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.42.inc
@@ -84,5 +84,6 @@  SRC_URI = "\
      file://CVE-2026-18220.patch \
      file://CVE-2026-3441_CVE-2026-3442.patch \
      file://CVE-2026-4647.patch \
+     file://CVE-2026-91781.patch \
 "
 S  = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2026-91781.patch b/meta/recipes-devtools/binutils/binutils/CVE-2026-91781.patch
new file mode 100644
index 0000000000..ff14147097
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/CVE-2026-91781.patch
@@ -0,0 +1,36 @@ 
+From 03e5dab2f6f1b3ccc151722f189642614fa09f13 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Thu, 30 Jul 2026 15:47:05 +0800
+Subject: [PATCH] x86-64: Return SHN_COMMON on non-ELF input
+
+elf_x86_64_common_definition segfaults on PE/x86-64 input.  Return
+SHN_COMMON on non-ELF input.  Linker now gets assertion fail at
+bfd/coffgen.c:575, instead of getting segfault.
+
+	PR ld/34449
+	* elf64-x86-64.c (elf_x86_64_common_definition): Return
+	SHN_COMMON on non-ELF input.
+
+Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
+
+CVE: CVE-2026-91781
+Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7322e9bc30cb282575a701c307851fd3d66fee68]
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+---
+ bfd/elf64-x86-64.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
+index abf97b2dde5..0d1ef1d38bc 100644
+--- a/bfd/elf64-x86-64.c
++++ b/bfd/elf64-x86-64.c
+@@ -5518,7 +5518,8 @@ elf_x86_64_common_definition (Elf_Internal_Sym *sym)
+ static unsigned int
+ elf_x86_64_common_section_index (asection *sec)
+ {
+-  if ((elf_section_flags (sec) & SHF_X86_64_LARGE) == 0)
++  if (bfd_get_flavour (sec->owner) != bfd_target_elf_flavour
++      || (elf_section_flags (sec) & SHF_X86_64_LARGE) == 0)
+     return SHN_COMMON;
+   else
+     return SHN_X86_64_LCOMMON;