]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
binutils: Fix CVE-2025-5244
authorDeepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Tue, 10 Jun 2025 04:36:54 +0000 (21:36 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 12 Jun 2025 10:02:56 +0000 (11:02 +0100)
PR32858 ld segfault on fuzzed object
We missed one place where it is necessary to check for empty groups.

Backport a patch from upstream to fix CVE-2025-5244
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=d1458933830456e54223d9fc61f0d9b3a19256f5]

Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/binutils/binutils-2.44.inc
meta/recipes-devtools/binutils/binutils/0019-CVE-2025-5244.patch [new file with mode: 0644]

index c3a597cd7b9cb55e1dcaaa99b804c90a5e093285..5f4da14f6aaa881ab0b0f15c49df5e837732f3ef 100644 (file)
@@ -41,5 +41,6 @@ SRC_URI = "\
      file://0016-CVE-2025-1181-1.patch \
      file://0017-CVE-2025-1181-2.patch \
      file://0018-CVE-2025-5245.patch \
+     file://0019-CVE-2025-5244.patch \
 "
 S  = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0019-CVE-2025-5244.patch b/meta/recipes-devtools/binutils/binutils/0019-CVE-2025-5244.patch
new file mode 100644 (file)
index 0000000..e8855a4
--- /dev/null
@@ -0,0 +1,25 @@
+From: Alan Modra <amodra@gmail.com>
+Date: Thu, 10 Apr 2025 19:41:49 +0930
+
+Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=d1458933830456e54223d9fc61f0d9b3a19256f5]
+CVE: CVE-2025-5244
+
+PR32858 ld segfault on fuzzed object
+We missed one place where it is necessary to check for empty groups.
+
+Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
+
+diff --git a/bfd/elflink.c b/bfd/elflink.c
+index a76e8e38da7..549b7b7dd92 100644
+--- a/bfd/elflink.c
++++ b/bfd/elflink.c
+@@ -14408,7 +14408,8 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
+         if (o->flags & SEC_GROUP)
+           {
+             asection *first = elf_next_in_group (o);
+-            o->gc_mark = first->gc_mark;
++            if (first != NULL)
++              o->gc_mark = first->gc_mark;
+           }
+         if (o->gc_mark)