linux-stable/kernel/trace
Steven Rostedt (Google) 0aa342e83f tracing: Check field value in hist_field_name()
commit 9f116f76fa upstream.

The function hist_field_name() cannot handle being passed a NULL field
parameter. It should never be NULL, but due to a previous bug, NULL was
passed to the function and the kernel crashed due to a NULL dereference.
Mark Rutland reported this to me on IRC.

The bug was fixed, but to prevent future bugs from crashing the kernel,
check the field and add a WARN_ON() if it is NULL.

Link: https://lkml.kernel.org/r/20230302020810.762384440@goodmis.org

Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Mark Rutland <mark.rutland@arm.com>
Fixes: c6afad49d1 ("tracing: Add hist trigger 'sym' and 'sym-offset' modifiers")
Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-22 13:38:01 +01:00
..
rv rv: remove redundant initialization of pointer ptr 2023-01-25 10:31:02 -05:00
blktrace.c trace/blktrace: fix memory leak with using debugfs_lookup() 2023-03-10 09:29:06 +01:00
bpf_trace.c bpf: Fix a possible task gone issue with bpf_send_signal[_thread]() helpers 2023-01-18 18:44:16 -08:00
bpf_trace.h
error_report-traces.c
fgraph.c arm64 fixes for 5.19-rc1: 2022-06-03 14:05:34 -07:00
fprobe.c tracing/fprobe: Fix to check whether fprobe is registered correctly 2022-11-04 08:50:07 +09:00
ftrace.c ftrace: Export ftrace_free_filter() to modules 2023-01-24 11:20:58 -05:00
ftrace_internal.h
Kconfig tracing: Kconfig: Fix spelling/grammar/punctuation 2023-01-24 13:22:38 -05:00
kprobe_event_gen_test.c tracing: kprobe: Fix potential null-ptr-deref on trace_array in kprobe_event_gen_test_exit() 2022-11-18 10:15:34 +09:00
Makefile rv: Add Runtime Verification (RV) interface 2022-07-30 14:01:28 -04:00
pid_list.c tracing: Cleanup double word in comment 2022-04-26 17:58:50 -04:00
pid_list.h
power-traces.c
preemptirq_delay_test.c
rethook.c rethook: fix a potential memleak in rethook_alloc() 2022-11-18 10:15:34 +09:00
ring_buffer.c tracing: Add NULL checks for buffer in ring_buffer_free_read_page() 2023-03-11 13:50:37 +01:00
ring_buffer_benchmark.c ring_buffer: Remove unused "event" parameter 2022-11-23 19:08:30 -05:00
rpm-traces.c
synth_event_gen_test.c tracing: Fix memory leak in test_gen_synth_cmd() and test_empty_synth_event() 2022-11-17 17:51:38 -05:00
trace.c tracing: Make splice_read available again 2023-03-22 13:38:01 +01:00
trace.h tracing: Fix TASK_COMM_LEN in trace event format file 2023-02-12 10:23:39 -05:00
trace_benchmark.c tracing: Add numeric delta time to the trace event benchmark 2022-09-26 13:01:09 -04:00
trace_benchmark.h tracing: Add numeric delta time to the trace event benchmark 2022-09-26 13:01:09 -04:00
trace_boot.c tracing: Initialize integer variable to prevent garbage return value 2022-05-26 21:13:00 -04:00
trace_branch.c
trace_clock.c
trace_dynevent.c tracing: Free buffers when a used dynamic event is removed 2022-11-23 19:07:12 -05:00
trace_dynevent.h
trace_entries.h
trace_eprobe.c tracing: Fix race where eprobes can be called before the event 2022-11-24 00:42:18 +09:00
trace_event_perf.c tracing/perf: Use strndup_user instead of kzalloc/strncpy_from_user 2022-11-23 19:08:31 -05:00
trace_events.c tracing: Make trace_define_field_ext() static 2023-02-12 20:14:11 -05:00
trace_events_filter.c tracing/filter: fix kernel-doc warnings 2023-01-25 10:28:13 -05:00
trace_events_filter_test.h
trace_events_hist.c tracing: Check field value in hist_field_name() 2023-03-22 13:38:01 +01:00
trace_events_inject.c
trace_events_synth.c tracing: Fix issue of missing one synthetic field 2022-12-10 13:36:04 -05:00
trace_events_trigger.c tracing: Do not synchronize freeing of trigger filter on boot up 2022-12-14 08:50:56 -05:00
trace_events_user.c Tracing updates for 6.2: 2022-12-15 18:01:16 -08:00
trace_export.c tracing: Fix TASK_COMM_LEN in trace event format file 2023-02-12 10:23:39 -05:00
trace_functions.c
trace_functions_graph.c
trace_hwlat.c
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c trace/kprobe: remove duplicated calls of ring_buffer_event_data 2022-12-09 23:48:05 -05:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_osnoise.c tracing/osnoise: Use built-in RCU list checking 2023-01-24 18:11:41 -05:00
trace_output.c tracing: Make sure trace_printk() can output as soon as it can be used 2023-01-24 11:27:29 -05:00
trace_output.h
trace_preemptirq.c tracing: hold caller_addr to hardirq_{enable,disable}_ip 2022-09-06 22:26:00 -04:00
trace_printk.c
trace_probe.c Trace probes updates for 6.2: 2022-12-21 18:57:24 -08:00
trace_probe.h tracing/probes: Reject symbol/symstr type for uprobe 2022-12-15 09:00:20 +09:00
trace_probe_kernel.h tracing: Add "(fault)" name injection to kernel probes 2022-10-12 13:50:20 -04:00
trace_probe_tmpl.h tracing/probes: Add symstr type for dynamic events 2022-12-15 08:48:57 +09:00
trace_recursion_record.c tracing: Use trace_create_file() to simplify creation of tracefs entries 2022-05-26 21:12:52 -04:00
trace_sched_switch.c sched/tracing: Append prev_state to tp args instead 2022-05-12 00:37:11 +02:00
trace_sched_wakeup.c sched/tracing: Append prev_state to tp args instead 2022-05-12 00:37:11 +02:00
trace_selftest.c x86/ftrace: Make it call depth tracking aware 2022-10-17 16:41:19 +02:00
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c
trace_stat.c
trace_stat.h
trace_synth.h
trace_syscalls.c tracing: Remove unused __bad_type_size() method 2022-11-17 20:21:06 -05:00
trace_uprobe.c tracing/probes: Reject symbol/symstr type for uprobe 2022-12-15 09:00:20 +09:00
tracing_map.c tracing: Remove unused variable 'dups' 2022-10-03 12:20:31 -04:00
tracing_map.h