Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'trace-v5.12-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fix from Steven Rostedt:
"Fix tp_printk command line and trace events

Masami added a wrapper to be able to unhash trace event pointers as
they are only read by root anyway, and they can also be extracted by
the raw trace data buffers. But this wrapper utilized the iterator to
have a temporary buffer to manipulate the text with.

tp_printk is a kernel command line option that will send the trace
output of a trace event to the console on boot up (useful when the
system crashes before finishing the boot). But the code used the same
wrapper that Masami added, and its iterator did not have a buffer, and
this caused the system to crash.

Have the wrapper just print the trace event normally if the iterator
has no temporary buffer"

* tag 'trace-v5.12-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
tracing: Fix checking event hash pointer logic when tp_printk is enabled

+7 -3
+7 -3
kernel/trace/trace.c
··· 3545 3545 { 3546 3546 char *tmp; 3547 3547 3548 - if (iter->fmt == static_fmt_buf) 3548 + /* 3549 + * iter->tr is NULL when used with tp_printk, which makes 3550 + * this get called where it is not safe to call krealloc(). 3551 + */ 3552 + if (!iter->tr || iter->fmt == static_fmt_buf) 3549 3553 return NULL; 3550 3554 3551 3555 tmp = krealloc(iter->fmt, iter->fmt_size + STATIC_FMT_BUF_SIZE, ··· 3570 3566 if (WARN_ON_ONCE(!fmt)) 3571 3567 return fmt; 3572 3568 3573 - if (iter->tr->trace_flags & TRACE_ITER_HASH_PTR) 3569 + if (!iter->tr || iter->tr->trace_flags & TRACE_ITER_HASH_PTR) 3574 3570 return fmt; 3575 3571 3576 3572 p = fmt; ··· 9696 9692 { 9697 9693 if (tracepoint_printk) { 9698 9694 tracepoint_print_iter = 9699 - kmalloc(sizeof(*tracepoint_print_iter), GFP_KERNEL); 9695 + kzalloc(sizeof(*tracepoint_print_iter), GFP_KERNEL); 9700 9696 if (MEM_FAIL(!tracepoint_print_iter, 9701 9697 "Failed to allocate trace iterator\n")) 9702 9698 tracepoint_printk = 0;