summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/elfutils/elfutils_0.191.bb1
-rw-r--r--meta/recipes-devtools/elfutils/files/CVE-2025-1371.patch41
2 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.191.bb b/meta/recipes-devtools/elfutils/elfutils_0.191.bb
index 85e024179b..bab3d94d12 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.191.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.191.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-1365.patch \ 27 file://CVE-2025-1365.patch \
28 file://CVE-2025-1372.patch \ 28 file://CVE-2025-1372.patch \
29 file://CVE-2025-1371.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-1371.patch b/meta/recipes-devtools/elfutils/files/CVE-2025-1371.patch
new file mode 100644
index 0000000000..ebb57bd4e5
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/CVE-2025-1371.patch
@@ -0,0 +1,41 @@
1From b38e562a4c907e08171c76b8b2def8464d5a104a Mon Sep 17 00:00:00 2001
2From: Mark Wielaard <mark@klomp.org>
3Date: Sun, 9 Feb 2025 00:07:13 +0100
4Subject: [PATCH] readelf: Handle NULL phdr in handle_dynamic_symtab
5
6A corrupt ELF file can have broken program headers, in which case
7gelf_getphdr returns NULL. This could crash handle_dynamic_symtab
8while searching for the PT_DYNAMIC phdr. Fix this by checking whether
9gelf_phdr returns NULL.
10
11 * src/readelf.c (handle_dynamic_symtab): Check whether
12 gelf_getphdr returns NULL.
13
14https://sourceware.org/bugzilla/show_bug.cgi?id=32655
15
16Signed-off-by: Mark Wielaard <mark@klomp.org>
17
18CVE: CVE-2025-1371
19
20Upstream-Status: Backport [https://sourceware.org/cgit/elfutils/commit/?id=b38e562a4c907e08171c76b8b2def8464d5a104a]
21
22Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com>
23---
24 src/readelf.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27diff --git a/src/readelf.c b/src/readelf.c
28index fc04556..13344bf 100644
29--- a/src/readelf.c
30+++ b/src/readelf.c
31@@ -2912,7 +2912,7 @@ handle_dynamic_symtab (Ebl *ebl)
32 for (size_t i = 0; i < phnum; ++i)
33 {
34 phdr = gelf_getphdr (ebl->elf, i, &phdr_mem);
35- if (phdr->p_type == PT_DYNAMIC)
36+ if (phdr == NULL || phdr->p_type == PT_DYNAMIC)
37 break;
38 }
39 if (phdr == NULL)
40--
412.40.0