@@ -38,4 +38,5 @@ SRC_URI = "\
file://0012-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \
file://0013-Define-alignof-using-_Alignof-when-using-C11-or-newe.patch \
file://0014-Remove-duplicate-pe-dll.o-entry-deom-targ_extra_ofil.patch \
+ file://CVE-2026-91781.patch \
"
new file mode 100644
@@ -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;
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.47 binutils-testsuite summary: binutils: 336 tests passed, 0 expected failures, 5 untested, 7 unsupported. gas: 2,098 tests passed, 0 expected failures, 0 untested, 4 unsupported. ld: 2,710 tests passed, 59 expected failures, 4 untested, 339 unsupported. 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.47.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