Commit 50a3242
committed
tracing: Fix trace_check_vprintf() when tp_printk is used
When the tp_printk kernel command line is used, the trace events go
directly to printk(). It is still checked via the trace_check_vprintf()
function to make sure the pointers of the trace event are legit.
The addition of reading buffers from previous boots required adding a
delta between the addresses of the previous boot and the current boot so
that the pointers in the old buffer can still be used. But this required
adding a trace_array pointer to acquire the delta offsets.
The tp_printk code does not provide a trace_array (tr) pointer, so when
the offsets were examined, a NULL pointer dereference happened and the
kernel crashed.
If the trace_array does not exist, just default the delta offsets to zero,
as that also means the trace event is not being read from a previous boot.
Link: https://lore.kernel.org/all/[email protected]/
Cc: Masami Hiramatsu <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Link: https://lore.kernel.org/[email protected]
Fixes: 07714b4 ("tracing: Handle old buffer mappings for event strings and functions")
Reported-by: Alison Schofield <[email protected]>
Tested-by: Alison Schofield <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>1 parent 9852d85 commit 50a3242
1 file changed
+13
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3697 | 3697 | | |
3698 | 3698 | | |
3699 | 3699 | | |
3700 | | - | |
3701 | | - | |
| 3700 | + | |
| 3701 | + | |
3702 | 3702 | | |
3703 | 3703 | | |
3704 | 3704 | | |
| |||
3710 | 3710 | | |
3711 | 3711 | | |
3712 | 3712 | | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
| 3721 | + | |
| 3722 | + | |
| 3723 | + | |
3713 | 3724 | | |
3714 | 3725 | | |
3715 | 3726 | | |
| |||
0 commit comments