diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-06-08 14:12:04 +0300 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-06-11 00:56:02 +0300 |
| commit | a0e4362a3e7b592f1d58949ffe3d6decad39a17c (patch) | |
| tree | 1794b03bc632e8b16ab17e73a82a90e009d04185 /scripts/Makefile.thinlto | |
| parent | aece2b8966fc8de5be46ee9287d0f60d6690c300 (diff) | |
| download | linux-a0e4362a3e7b592f1d58949ffe3d6decad39a17c.tar.xz | |
perf bpf: Fix metadata leak in perf_env__add_bpf_info() on duplicate insert
When perf_env__insert_bpf_prog_info() returns false (duplicate
program), the error path frees info_linear and info_node but not
info_node->metadata. If bpf_metadata_create() had succeeded, the
metadata allocation is permanently leaked.
Fix by calling bpf_metadata_free() on info_node->metadata before
freeing info_node. bpf_metadata_free() handles NULL, so this is
safe even when bpf_metadata_create() returned NULL.
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Fixes: fdc3441f2d317b40 ("perf record: collect BPF metadata from new programs")
Cc: Blake Jones <blakejones@google.com>
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
