Zilin Guan
9649275aee
tracing: Fix memory leaks in create_field_var()
...
[ Upstream commit 80f0d631dcc76ee1b7755bfca1d8417d91d71414 ]
The function create_field_var() allocates memory for 'val' through
create_hist_field() inside parse_atom(), and for 'var' through
create_var(), which in turn allocates var->type and var->var.name
internally. Simply calling kfree() to release these structures will
result in memory leaks.
Use destroy_hist_field() to properly free 'val', and explicitly release
the memory of var->type and var->var.name before freeing 'var' itself.
Link: https://patch.msgid.link/20251106120132.3639920-1-zilin@seu.edu.cn
Fixes: 02205a6752 ("tracing: Add support for 'field variables'")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-12-03 12:45:16 +01:00
..
blktrace.c
bpf_trace.c
bpf: Fix WARN() in get_bpf_raw_tp_regs
2025-06-27 11:02:46 +01:00
fgraph.c
ftrace.c
ftrace: Also allocate and copy hash for reading of filter files
2025-08-28 16:21:32 +02:00
ftrace_internal.h
Kconfig
Makefile
power-traces.c
preemptirq_delay_test.c
tracing: Add MODULE_DESCRIPTION() to preemptirq_delay_test
2024-07-05 09:08:25 +02:00
ring_buffer.c
ring-buffer: Fix bytes_dropped calculation issue
2025-04-10 14:29:42 +02:00
ring_buffer_benchmark.c
rpm-traces.c
trace.c
ftrace: Fix potential warning in trace_printk_seq during ftrace_dump
2025-09-04 14:05:53 +02:00
trace.h
trace_benchmark.c
trace_benchmark.h
trace_branch.c
trace_clock.c
tracing: Use atomic64_inc_return() in trace_clock_counter()
2024-12-14 19:44:53 +01:00
trace_dynevent.c
trace_dynevent.h
trace_entries.h
trace_event_perf.c
trace/trace_event_perf: remove duplicate samples on the first tracepoint event
2024-12-14 19:44:28 +01:00
trace_events.c
tracing: Add down_write(trace_event_sem) when adding trace event
2025-08-28 16:21:34 +02:00
trace_events_filter.c
trace_events_filter_test.h
trace_events_hist.c
tracing: Fix memory leaks in create_field_var()
2025-12-03 12:45:16 +01:00
trace_events_trigger.c
Revert "tracing/trigger: Fix to return error if failed to alloc snapshot"
2024-05-02 16:18:30 +02:00
trace_export.c
trace_functions.c
trace_functions_graph.c
tracing: Fix use-after-free in print_graph_function_flags during tracer switching
2025-04-10 14:29:43 +02:00
trace_hwlat.c
trace_irqsoff.c
tracing: Fix use-after-free in print_graph_function_flags during tracer switching
2025-04-10 14:29:43 +02:00
trace_kdb.c
trace_kprobe.c
tracing: Fix race condition in kprobe initialization causing NULL pointer dereference
2025-10-29 13:59:55 +01:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_output.c
tracing: Remove precision vsnprintf() check from print event
2024-11-08 16:20:43 +01:00
trace_output.h
trace_preemptirq.c
trace_printk.c
trace_probe.c
tracing: Consider the NULL character when validating the event length
2024-11-08 16:20:51 +01:00
trace_probe.h
tracing: Fix race condition in kprobe initialization causing NULL pointer dereference
2025-10-29 13:59:55 +01:00
trace_probe_tmpl.h
trace_sched_switch.c
trace_sched_wakeup.c
tracing: Fix use-after-free in print_graph_function_flags during tracer switching
2025-04-10 14:29:43 +02:00
trace_selftest.c
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c
trace_stat.c
trace_stat.h
trace_syscalls.c
trace_uprobe.c
tracing: Fix race condition in kprobe initialization causing NULL pointer dereference
2025-10-29 13:59:55 +01:00
tracing_map.c
tracing: Fix cmp_entries_dup() to respect sort() comparison rules
2024-12-14 19:44:48 +01:00
tracing_map.h