diff options
Diffstat (limited to 'meta/recipes-devtools/elfutils/files/CVE-2025-1372.patch')
-rw-r--r-- | meta/recipes-devtools/elfutils/files/CVE-2025-1372.patch | 50 |
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 @@ | |||
1 | From 73db9d2021cab9e23fd734b0a76a612d52a6f1db Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Wielaard <mark@klomp.org> | ||
3 | Date: Sun, 9 Feb 2025 00:07:39 +0100 | ||
4 | Subject: [PATCH] readelf: Skip trying to uncompress sections without a name | ||
5 | |||
6 | When combining eu-readelf -z with -x or -p to dump the data or strings | ||
7 | in an (corrupted ELF) unnamed numbered section eu-readelf could crash | ||
8 | trying to check whether the section name starts with .zdebug. Fix this | ||
9 | by 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 | |||
15 | https://sourceware.org/bugzilla/show_bug.cgi?id=32656 | ||
16 | |||
17 | Signed-off-by: Mark Wielaard <mark@klomp.org> | ||
18 | |||
19 | Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=73db9d2021cab9e23fd734b0a76a612d52a6f1db] | ||
20 | CVE: CVE-2025-1372 | ||
21 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
22 | --- | ||
23 | src/readelf.c | 4 ++-- | ||
24 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
25 | |||
26 | diff --git a/src/readelf.c b/src/readelf.c | ||
27 | index 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 | -- | ||
49 | 2.25.1 | ||
50 | |||