summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-devtools/pahole/files/0001-btf_encoder-Fix-elf_functions-cleanup-on-error.patch54
-rw-r--r--meta-oe/recipes-devtools/pahole/pahole_1.29.bb3
2 files changed, 56 insertions, 1 deletions
diff --git a/meta-oe/recipes-devtools/pahole/files/0001-btf_encoder-Fix-elf_functions-cleanup-on-error.patch b/meta-oe/recipes-devtools/pahole/files/0001-btf_encoder-Fix-elf_functions-cleanup-on-error.patch
new file mode 100644
index 0000000000..dad5a9646a
--- /dev/null
+++ b/meta-oe/recipes-devtools/pahole/files/0001-btf_encoder-Fix-elf_functions-cleanup-on-error.patch
@@ -0,0 +1,54 @@
1From 6fa2b7de3e647e64c5d693aea7f3bacbfa964f53 Mon Sep 17 00:00:00 2001
2From: Ihor Solodari <ihor.solodrai@linux.dev>
3Date: Wed, 20 Aug 2025 09:00:03 +0100
4Subject: [PATCH] btf_encoder: Fix elf_functions cleanup on error
5
6When elf_functions__new() errors out and jumps to
7elf_functions__delete(), pahole segfaults on attempt to list_del() the
8elf_functions instance from a list, to which it was never added.
9
10Fix this by moving list_del() call out of elf_functions__delete().
11Remove from the list only on normal cleanup in
12elf_functions_list__clear().
13
14v1:
15https://lore.kernel.org/dwarves/979a1ac4-21d3-4384-8ce4-d10f41887088@linux.dev/
16
17Closes:
18https://lore.kernel.org/dwarves/24bcc853-533c-42ab-bc37-0c13e0baa217@windriver.com/
19Reported-by: Changqing Li <changqing.li@windriver.com>
20Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
21Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>
22Link: https://lore.kernel.org/dwarves/acef4a0e-7d3b-4e05-b3ca-1007580f2754@linux.dev/
23Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
24
25Upstream-Status: Backport [https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?h=next&id=fe6738f4b46b63dcdc5b15b252a014b3eaba16a4]
26
27Signed-off-by: Changqing Li <changqing.li@windriver.com>
28---
29 btf_encoder.c | 2 +-
30 1 file changed, 1 insertion(+), 1 deletion(-)
31
32diff --git a/btf_encoder.c b/btf_encoder.c
33index 511c1ea..2f8c6bb 100644
34--- a/btf_encoder.c
35+++ b/btf_encoder.c
36@@ -162,7 +162,6 @@ static inline void elf_functions__delete(struct elf_functions *funcs)
37 free(funcs->entries[i].alias);
38 free(funcs->entries);
39 elf_symtab__delete(funcs->symtab);
40- list_del(&funcs->node);
41 free(funcs);
42 }
43
44@@ -204,6 +203,7 @@ static inline void elf_functions_list__clear(struct list_head *elf_functions_lis
45
46 list_for_each_safe(pos, tmp, elf_functions_list) {
47 funcs = list_entry(pos, struct elf_functions, node);
48+ list_del(&funcs->node);
49 elf_functions__delete(funcs);
50 }
51 }
52--
532.34.1
54
diff --git a/meta-oe/recipes-devtools/pahole/pahole_1.29.bb b/meta-oe/recipes-devtools/pahole/pahole_1.29.bb
index aca915bf32..4f2737767b 100644
--- a/meta-oe/recipes-devtools/pahole/pahole_1.29.bb
+++ b/meta-oe/recipes-devtools/pahole/pahole_1.29.bb
@@ -11,7 +11,8 @@ COMPATIBLE_HOST = "(x86_64|i.86|arm|aarch64|riscv64|powerpc|powerpc64|mips64).*-
11 11
12SRCREV = "b9cc7963051b2099795129450f9b70c81950d02f" 12SRCREV = "b9cc7963051b2099795129450f9b70c81950d02f"
13SRC_URI = "git://git.kernel.org/pub/scm/devel/pahole/pahole.git;branch=master \ 13SRC_URI = "git://git.kernel.org/pub/scm/devel/pahole/pahole.git;branch=master \
14 file://0001-Use-usr-bin-env-python3-instead-of-just-usr-bin-pyth.patch" 14 file://0001-Use-usr-bin-env-python3-instead-of-just-usr-bin-pyth.patch \
15 file://0001-btf_encoder-Fix-elf_functions-cleanup-on-error.patch"
15 16
16 17
17inherit cmake pkgconfig 18inherit cmake pkgconfig