android_kernel_motorola_sm6375/kernel/trace
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jia-Ju Bai 2cc6a3e98f tracing: Add NULL checks for buffer in ring_buffer_free_read_page()
[ Upstream commit 3e4272b9954094907f16861199728f14002fcaf6 ]

In a previous commit 7433632c9ff6, buffer, buffer->buffers and
buffer->buffers[cpu] in ring_buffer_wake_waiters() can be NULL,
and thus the related checks are added.

However, in the same call stack, these variables are also used in
ring_buffer_free_read_page():

tracing_buffers_release()
  ring_buffer_wake_waiters(iter->array_buffer->buffer)
    cpu_buffer = buffer->buffers[cpu] -> Add checks by previous commit
  ring_buffer_free_read_page(iter->array_buffer->buffer)
    cpu_buffer = buffer->buffers[cpu] -> No check

Thus, to avod possible null-pointer derefernces, the related checks
should be added.

These results are reported by a static tool designed by myself.

Link: https://lkml.kernel.org/r/20230113125501.760324-1-baijiaju1990@gmail.com

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-11 16:44:13 +01:00
..
blktrace.c blktrace: Fix output non-blktrace event when blk_classic option enabled 2023-01-18 11:41:13 +01:00
bpf_trace.c bpf: Skip task with pid=1 in send_signal_common() 2023-02-06 07:52:48 +01:00
fgraph.c
ftrace.c ftrace: Fix null pointer dereference in ftrace_add_mod() 2022-11-25 17:42:17 +01:00
ftrace_internal.h
Kconfig
Makefile
power-traces.c
preemptirq_delay_test.c
ring_buffer.c tracing: Add NULL checks for buffer in ring_buffer_free_read_page() 2023-03-11 16:44:13 +01:00
ring_buffer_benchmark.c
rpm-traces.c
trace.c tracing: Fix poll() and select() do not work on per_cpu trace_pipe and trace_pipe_raw 2023-02-22 12:50:30 +01:00
trace.h tracing: Make sure trace_printk() can output as soon as it can be used 2023-02-06 07:52:43 +01:00
trace_benchmark.c
trace_benchmark.h
trace_branch.c
trace_clock.c
trace_dynevent.c tracing: Free buffers when a used dynamic event is removed 2022-12-08 11:23:04 +01:00
trace_dynevent.h
trace_entries.h
trace_event_perf.c
trace_events.c tracing: Free buffers when a used dynamic event is removed 2022-12-08 11:23:04 +01:00
trace_events_filter.c
trace_events_filter_test.h
trace_events_hist.c trace_events_hist: add check for return value of 'create_hist_field' 2023-02-06 07:52:44 +01:00
trace_events_trigger.c tracing: Dump stacktrace trigger to the corresponding instance 2022-04-27 13:50:45 +02:00
trace_export.c
trace_functions.c tracing: Have all levels of checks prevent recursion 2021-10-27 09:54:29 +02:00
trace_functions_graph.c
trace_hwlat.c
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c tracing: Fix return value of __setup handlers 2022-03-08 19:07:50 +01:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_output.c tracing: Make sure trace_printk() can output as soon as it can be used 2023-02-06 07:52:43 +01:00
trace_output.h
trace_preemptirq.c tracing: hold caller_addr to hardirq_{enable,disable}_ip 2022-09-28 11:03:57 +02:00
trace_printk.c
trace_probe.c tracing/probes: Have kprobes and uprobes use $COMM too 2022-08-25 11:18:39 +02:00
trace_probe.h tracing/probes: Reject events which have the same name of existing one 2021-09-22 12:26:43 +02:00
trace_probe_tmpl.h
trace_sched_switch.c
trace_sched_wakeup.c
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/uprobe: Fix uprobe_perf_open probes iteration 2021-12-01 09:23:29 +01:00
tracing_map.c tracing: Fix a kmemleak false positive in tracing_map 2021-12-17 10:12:24 +01:00
tracing_map.h