summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorSoumya Sambu <soumya.sambu@windriver.com>2025-11-14 17:49:41 +0530
committerSteve Sakoman <steve@sakoman.com>2025-11-24 06:57:39 -0800
commit36037789d23df9db38fbbe5351d1a25fbe85e61d (patch)
tree0e6965dc420a9dc3cdfecf537cd6af846e0aafe3 /meta
parent7dd51aea98fbf282536ae4f78a86ae4b63e5a1dc (diff)
downloadpoky-36037789d23df9db38fbbe5351d1a25fbe85e61d.tar.gz
elfutils: Fix CVE-2025-1377
A vulnerability, which was classified as problematic, has been found in GNU elfutils 0.192. This issue affects the function gelf_getsymshndx of the file strip.c of the component eu-strip. The manipulation leads to denial of service. The attack needs to be approached locally. The exploit has been disclosed to the public and may be used. The identifier of the patch is fbf1df9ca286de3323ae541973b08449f8d03aba. It is recommended to apply a patch to fix this issue. Reference: https://nvd.nist.gov/vuln/detail/CVE-2025-1377 Upstream patch: https://sourceware.org/git/?p=elfutils.git;a=commit;h=fbf1df9ca286de3323ae541973b08449f8d03aba (From OE-Core rev: e4e8392e688ceb0d8e68fe48118383c031178b5e) Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/elfutils/elfutils_0.186.bb1
-rw-r--r--meta/recipes-devtools/elfutils/files/CVE-2025-1377.patch68
2 files changed, 69 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.186.bb b/meta/recipes-devtools/elfutils/elfutils_0.186.bb
index 9f0fb43d50..f97a97c673 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.186.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.186.bb
@@ -26,6 +26,7 @@ SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
26 file://CVE-2025-1352.patch \ 26 file://CVE-2025-1352.patch \
27 file://CVE-2025-1372.patch \ 27 file://CVE-2025-1372.patch \
28 file://CVE-2025-1376.patch \ 28 file://CVE-2025-1376.patch \
29 file://CVE-2025-1377.patch \
29 " 30 "
30SRC_URI:append:libc-musl = " \ 31SRC_URI:append:libc-musl = " \
31 file://0003-musl-utils.patch \ 32 file://0003-musl-utils.patch \
diff --git a/meta/recipes-devtools/elfutils/files/CVE-2025-1377.patch b/meta/recipes-devtools/elfutils/files/CVE-2025-1377.patch
new file mode 100644
index 0000000000..de263738f2
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/CVE-2025-1377.patch
@@ -0,0 +1,68 @@
1From fbf1df9ca286de3323ae541973b08449f8d03aba Mon Sep 17 00:00:00 2001
2From: Mark Wielaard <mark@klomp.org>
3Date: Thu, 13 Feb 2025 14:59:34 +0100
4Subject: [PATCH] strip: Verify symbol table is a real symbol table
5
6We didn't check the symbol table referenced from the relocation table
7was a real symbol table. This could cause a crash if that section
8happened to be an SHT_NOBITS section without any data. Fix this by
9adding an explicit check.
10
11 * src/strip.c (INTERNAL_ERROR_MSG): New macro that takes a
12 message string to display.
13 (INTERNAL_ERROR): Use INTERNAL_ERROR_MSG with elf_errmsg (-1).
14 (remove_debug_relocations): Check the sh_link referenced
15 section is real and isn't a SHT_NOBITS section.
16
17https://sourceware.org/bugzilla/show_bug.cgi?id=32673
18
19Signed-off-by: Mark Wielaard <mark@klomp.org>
20
21CVE: CVE-2025-1377
22
23Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=fbf1df9ca286de3323ae541973b08449f8d03aba]
24
25Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com>
26---
27 src/strip.c | 13 ++++++++++---
28 1 file changed, 10 insertions(+), 3 deletions(-)
29
30diff --git a/src/strip.c b/src/strip.c
31index d5b753d..0cfd8c8 100644
32--- a/src/strip.c
33+++ b/src/strip.c
34@@ -127,13 +127,14 @@ static char *tmp_debug_fname = NULL;
35 /* Close debug file descriptor, if opened. And remove temporary debug file. */
36 static void cleanup_debug (void);
37
38-#define INTERNAL_ERROR(fname) \
39+#define INTERNAL_ERROR_MSG(fname, msg) \
40 do { \
41 cleanup_debug (); \
42 error (EXIT_FAILURE, 0, _("%s: INTERNAL ERROR %d (%s): %s"), \
43- fname, __LINE__, PACKAGE_VERSION, elf_errmsg (-1)); \
44+ fname, __LINE__, PACKAGE_VERSION, msg); \
45 } while (0)
46
47+#define INTERNAL_ERROR(fname) INTERNAL_ERROR_MSG(fname, elf_errmsg (-1))
48
49 /* Name of the output file. */
50 static const char *output_fname;
51@@ -632,7 +633,13 @@ remove_debug_relocations (Ebl *ebl, Elf *elf, GElf_Ehdr *ehdr,
52 resolve relocation symbol indexes. */
53 Elf64_Word symt = shdr->sh_link;
54 Elf_Data *symdata, *xndxdata;
55- Elf_Scn * symscn = elf_getscn (elf, symt);
56+ Elf_Scn *symscn = elf_getscn (elf, symt);GElf_Shdr symshdr_mem;
57+ GElf_Shdr *symshdr = gelf_getshdr (symscn, &symshdr_mem);
58+ if (symshdr == NULL)
59+ INTERNAL_ERROR (fname);
60+ if (symshdr->sh_type == SHT_NOBITS)
61+ INTERNAL_ERROR_MSG (fname, "NOBITS section");
62+
63 symdata = elf_getdata (symscn, NULL);
64 xndxdata = get_xndxdata (elf, symscn);
65 if (symdata == NULL)
66--
672.40.0
68