summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils/files/CVE-2025-1372.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/elfutils/files/CVE-2025-1372.patch')
-rw-r--r--meta/recipes-devtools/elfutils/files/CVE-2025-1372.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/files/CVE-2025-1372.patch b/meta/recipes-devtools/elfutils/files/CVE-2025-1372.patch
new file mode 100644
index 0000000000..812a098447
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/CVE-2025-1372.patch
@@ -0,0 +1,50 @@
1From 73db9d2021cab9e23fd734b0a76a612d52a6f1db Mon Sep 17 00:00:00 2001
2From: Mark Wielaard <mark@klomp.org>
3Date: Sun, 9 Feb 2025 00:07:39 +0100
4Subject: [PATCH] readelf: Skip trying to uncompress sections without a name
5
6When combining eu-readelf -z with -x or -p to dump the data or strings
7in an (corrupted ELF) unnamed numbered section eu-readelf could crash
8trying to check whether the section name starts with .zdebug. Fix this
9by skipping sections without a name.
10
11 * src/readelf.c (dump_data_section): Don't try to gnu decompress a
12 section without a name.
13 (print_string_section): Likewise.
14
15https://sourceware.org/bugzilla/show_bug.cgi?id=32656
16
17Signed-off-by: Mark Wielaard <mark@klomp.org>
18
19Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=73db9d2021cab9e23fd734b0a76a612d52a6f1db]
20CVE: CVE-2025-1372
21Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
22---
23 src/readelf.c | 4 ++--
24 1 file changed, 2 insertions(+), 2 deletions(-)
25
26diff --git a/src/readelf.c b/src/readelf.c
27index 63eb548..fc04556 100644
28--- a/src/readelf.c
29+++ b/src/readelf.c
30@@ -13327,7 +13327,7 @@ dump_data_section (Elf_Scn *scn, const GElf_Shdr *shdr, const char *name)
31 _("Couldn't uncompress section"),
32 elf_ndxscn (scn));
33 }
34- else if (startswith (name, ".zdebug"))
35+ else if (name && startswith (name, ".zdebug"))
36 {
37 if (elf_compress_gnu (scn, 0, 0) < 0)
38 printf ("WARNING: %s [%zd]\n",
39@@ -13378,7 +13378,7 @@ print_string_section (Elf_Scn *scn, const GElf_Shdr *shdr, const char *name)
40 _("Couldn't uncompress section"),
41 elf_ndxscn (scn));
42 }
43- else if (startswith (name, ".zdebug"))
44+ else if (name && startswith (name, ".zdebug"))
45 {
46 if (elf_compress_gnu (scn, 0, 0) < 0)
47 printf ("WARNING: %s [%zd]\n",
48--
492.25.1
50