From 76421a969a41e8b7734fe411e6fb2e9df8719374 Mon Sep 17 00:00:00 2001 From: Riccardo Mancini Date: Thu, 10 Jun 2021 19:27:59 +0800 Subject: [PATCH] perf symbol-elf: Fix memory leak by freeing sdt_note.args mainline inclusion from mainline-5.13-rc4 commit 69c9ffed6cede9c11697861f654946e3ae95a930 category: bugfix bugzilla: 78200 CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=69c9ffed6cede9c11697861f654946e3ae95a930 --------------------------- Reported by ASan. Signed-off-by: Riccardo Mancini Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Fabian Hemmer Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Remi Bernon Cc: Jiri Slaby Link: http://lore.kernel.org/lkml/20210602220833.285226-1-rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Yang Jihong Reviewed-by: Kuohai Xu Signed-off-by: Chen Jun Signed-off-by: Zheng Zengkai --- tools/perf/util/symbol-elf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 44dd86a4f25f..7356eb398b32 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -2360,6 +2360,7 @@ int cleanup_sdt_note_list(struct list_head *sdt_notes) list_for_each_entry_safe(pos, tmp, sdt_notes, note_list) { list_del_init(&pos->note_list); + zfree(&pos->args); zfree(&pos->name); zfree(&pos->provider); free(pos); -- GitLab