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-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull workqueue tracing fix from Steven Rostedt:
"Fix workqueue trace event unsafe string reference

After adding a verifier to test all strings printed in trace events to
make sure they either point to a string on the ring buffer, or to read
only core kernel memory, it triggered on a workqueue trace event. The
trace event workqueue_queue_work references the allocated name of the
workqueue in the output. If the workqueue is freed before the trace is
read, then the trace will dereference freed memory.

Update the trace event to use the __string(), __assign_str(), and
__get_str() helpers to handle such cases"

* tag 'trace-v5.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
workqueue/tracing: Copy workqueue name to buffer in trace event

+3 -3
+3 -3
include/trace/events/workqueue.h
··· 30 30 TP_STRUCT__entry( 31 31 __field( void *, work ) 32 32 __field( void *, function) 33 - __field( const char *, workqueue) 33 + __string( workqueue, pwq->wq->name) 34 34 __field( unsigned int, req_cpu ) 35 35 __field( unsigned int, cpu ) 36 36 ), ··· 38 38 TP_fast_assign( 39 39 __entry->work = work; 40 40 __entry->function = work->func; 41 - __entry->workqueue = pwq->wq->name; 41 + __assign_str(workqueue, pwq->wq->name); 42 42 __entry->req_cpu = req_cpu; 43 43 __entry->cpu = pwq->pool->cpu; 44 44 ), 45 45 46 46 TP_printk("work struct=%p function=%ps workqueue=%s req_cpu=%u cpu=%u", 47 - __entry->work, __entry->function, __entry->workqueue, 47 + __entry->work, __entry->function, __get_str(workqueue), 48 48 __entry->req_cpu, __entry->cpu) 49 49 ); 50 50