summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils/files
diff options
context:
space:
mode:
authorSoumya Sambu <soumya.sambu@windriver.com>2025-10-24 18:50:47 +0530
committerSteve Sakoman <steve@sakoman.com>2025-11-03 07:17:01 -0800
commit12f14af0bb0d57f2eace60ee5027dc83bfdc48ca (patch)
treed24ce45255a5736536cc1fa8ae01eb0b674e3feb /meta/recipes-devtools/elfutils/files
parent2421e79018781d1b85a577cf6f6cbd6294a712ca (diff)
downloadpoky-12f14af0bb0d57f2eace60ee5027dc83bfdc48ca.tar.gz
elfutils: Fix CVE-2025-1376
A vulnerability classified as problematic was found in GNU elfutils 0.192. This vulnerability affects the function elf_strptr in the library /libelf/elf_strptr.c of the component eu-strip. The manipulation leads to denial of service. It is possible to launch the attack on the local host. The complexity of an attack is rather high. The exploitation appears to be difficult. The exploit has been disclosed to the public and may be used. The name of the patch is b16f441cca0a4841050e3215a9f120a6d8aea918. It is recommended to apply a patch to fix this issue. Reference: https://nvd.nist.gov/vuln/detail/CVE-2025-1376 Upstream patch: https://sourceware.org/git/?p=elfutils.git;a=commit;h=b16f441cca0a4841050e3215a9f120a6d8aea918 (From OE-Core rev: 06e3cd0891f553b0ed036d9247dfa7c5ed814d78) Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-devtools/elfutils/files')
-rw-r--r--meta/recipes-devtools/elfutils/files/CVE-2025-1376.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/files/CVE-2025-1376.patch b/meta/recipes-devtools/elfutils/files/CVE-2025-1376.patch
new file mode 100644
index 0000000000..1f40add305
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/CVE-2025-1376.patch
@@ -0,0 +1,58 @@
1From b16f441cca0a4841050e3215a9f120a6d8aea918 Mon Sep 17 00:00:00 2001
2From: Mark Wielaard <mark@klomp.org>
3Date: Thu, 13 Feb 2025 00:02:32 +0100
4Subject: [PATCH] libelf: Handle elf_strptr on section without any data
5
6In the unlikely situation that elf_strptr was called on a section with
7sh_size already set, but that doesn't have any data yet we could crash
8trying to verify the string to return.
9
10This could happen for example when a new section was created with
11elf_newscn, but no data having been added yet.
12
13 * libelf/elf_strptr.c (elf_strptr): Check strscn->rawdata_base
14 is not NULL.
15
16https://sourceware.org/bugzilla/show_bug.cgi?id=32672
17
18Signed-off-by: Mark Wielaard <mark@klomp.org>
19
20CVE: CVE-2025-1376
21
22Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=b16f441cca0a4841050e3215a9f120a6d8aea918]
23
24Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com>
25---
26 libelf/elf_strptr.c | 10 +++++++---
27 1 file changed, 7 insertions(+), 3 deletions(-)
28
29diff --git a/libelf/elf_strptr.c b/libelf/elf_strptr.c
30index c5a94f8..7be7f5e 100644
31--- a/libelf/elf_strptr.c
32+++ b/libelf/elf_strptr.c
33@@ -1,5 +1,6 @@
34 /* Return string pointer from string section.
35 Copyright (C) 1998-2002, 2004, 2008, 2009, 2015 Red Hat, Inc.
36+ Copyright (C) 2025 Mark J. Wielaard <mark@klomp.org>
37 This file is part of elfutils.
38 Contributed by Ulrich Drepper <drepper@redhat.com>, 1998.
39
40@@ -183,9 +184,12 @@ elf_strptr (Elf *elf, size_t idx, size_t offset)
41 // initialized yet (when data_read is zero). So we cannot just
42 // look at the rawdata.d.d_size.
43
44- /* Make sure the string is NUL terminated. Start from the end,
45- which very likely is a NUL char. */
46- if (likely (validate_str (strscn->rawdata_base, offset, sh_size)))
47+ /* First check there actually is any data. This could be a new
48+ section which hasn't had any data set yet. Then make sure
49+ the string is at a valid offset and NUL terminated. */
50+ if (unlikely (strscn->rawdata_base == NULL))
51+ __libelf_seterrno (ELF_E_INVALID_SECTION);
52+ else if (likely (validate_str (strscn->rawdata_base, offset, sh_size)))
53 result = &strscn->rawdata_base[offset];
54 else
55 __libelf_seterrno (ELF_E_INVALID_INDEX);
56--
572.40.0
58