Steven Rostedt (VMware)
3d9622c12c
tracing: Add barrier to trace_printk() buffer nesting modification
...
trace_printk() uses 4 buffers, one for each context (normal, softirq, irq
and NMI), such that it does not need to worry about one context preempting
the other. There's a nesting counter that gets incremented to figure out
which buffer to use. If the context gets preempted by another context which
calls trace_printk() it will increment the counter and use the next buffer,
and restore the counter when it is finished.
The problem is that gcc may optimize the modification of the buffer nesting
counter and it may not be incremented in memory before the buffer is used.
If this happens, and the context gets interrupted by another context, it
could pick the same buffer and corrupt the one that is being used.
Compiler barriers need to be added after the nesting variable is incremented
and before it is decremented to prevent usage of the context buffers by more
than one context at the same time.
Cc: Andy Lutomirski <luto@kernel.org>
Cc: stable@vger.kernel.org
Fixes: e2ace00117 ("tracing: Choose static tp_printk buffer by explicit nesting count")
Hat-tip-to: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-09-05 11:54:33 -04:00
..
blktrace.c
block: switch bios to blk_status_t
2017-06-09 09:27:32 -06:00
bpf_trace.c
bpf: fix bpf_trace_printk on 32 bit archs
2017-08-15 17:32:15 -07:00
ftrace.c
ftrace: Fix memleak when unregistering dynamic ops when tracing disabled
2017-09-01 13:55:49 -04:00
Kconfig
tracing: Rename update the enum_map file
2017-06-13 17:13:06 -04:00
Makefile
perf/core: Rename CONFIG_[UK]PROBE_EVENT to CONFIG_[UK]PROBE_EVENTS
2017-03-01 10:26:39 +01:00
power-traces.c
ring_buffer.c
ring-buffer: Have ring_buffer_alloc_read_page() return error on offline CPU
2017-08-02 14:23:02 -04:00
ring_buffer_benchmark.c
ring-buffer: Have ring_buffer_alloc_read_page() return error on offline CPU
2017-08-02 14:23:02 -04:00
rpm-traces.c
trace.c
tracing: Add barrier to trace_printk() buffer nesting modification
2017-09-05 11:54:33 -04:00
trace.h
tracing: Only have rmmod clear buffers that its events were active in
2017-08-31 17:47:38 -04:00
trace_benchmark.c
tracing: Have the trace_event benchmark thread call cond_resched_rcu_qs()
2017-04-17 15:21:19 -04:00
trace_benchmark.h
tracing: Have the reg function allow to fail
2016-12-09 09:13:30 -05:00
trace_branch.c
tracing: Add the constant count for branch tracer
2017-01-19 08:57:41 -05:00
trace_clock.c
sched/headers: Prepare for new header dependencies before moving code to <linux/sched/clock.h>
2017-03-02 08:42:27 +01:00
trace_entries.h
trace: make trace_hwlat timestamp y2038 safe
2017-05-08 17:15:15 -07:00
trace_event_perf.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
2016-05-17 16:26:30 -07:00
trace_events.c
tracing: Only have rmmod clear buffers that its events were active in
2017-08-31 17:47:38 -04:00
trace_events_filter.c
tracing: Fix freeing of filter in create_filter() when set_str is false
2017-08-24 10:07:38 -04:00
trace_events_filter_test.h
trace_events_hist.c
sched/headers: Prepare to use <linux/rcuupdate.h> instead of <linux/rculist.h> in <linux/sched.h>
2017-03-02 08:42:38 +01:00
trace_events_trigger.c
sched/headers: Prepare to use <linux/rcuupdate.h> instead of <linux/rculist.h> in <linux/sched.h>
2017-03-02 08:42:38 +01:00
trace_export.c
trace_functions.c
ftrace: Fix regression with module command in stack_trace_filter
2017-06-29 10:05:45 -04:00
trace_functions_graph.c
tracing/fgraph: Have wakeup and irqsoff tracers ignore graph functions too
2016-12-09 09:21:35 -05:00
trace_hwlat.c
trace: make trace_hwlat timestamp y2038 safe
2017-05-08 17:15:15 -07:00
trace_irqsoff.c
clocksource: Use a plain u64 instead of cycle_t
2016-12-25 11:04:12 +01:00
trace_kdb.c
trace_kprobe.c
A few more minor updates:
2017-07-13 13:17:19 -07:00
trace_mmiotrace.c
tracing: Expose CPU physical addresses (resource values) for PCI devices
2016-06-20 09:54:22 -04:00
trace_nop.c
trace_output.c
tracing: Add support for display of tgid in trace output
2017-06-27 13:30:28 -04:00
trace_output.h
trace_printk.c
tracing: Handle NULL formats in hold_module_trace_bprintk_format()
2016-06-20 09:46:12 -04:00
trace_probe.c
tracing/probes: Fix a warning message to show correct maximum length
2017-02-15 10:32:48 -05:00
trace_probe.h
perf/core: Rename CONFIG_[UK]PROBE_EVENT to CONFIG_[UK]PROBE_EVENTS
2017-03-01 10:26:39 +01:00
trace_sched_switch.c
tracing: Add support for recording tgid of tasks
2017-06-27 13:30:28 -04:00
trace_sched_wakeup.c
clocksource: Use a plain u64 instead of cycle_t
2016-12-25 11:04:12 +01:00
trace_selftest.c
ftrace: Fix selftest goto location on error
2017-09-01 12:04:09 -04:00
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c
tracing: Do note expose stack_trace_filter without DYNAMIC_FTRACE
2017-07-11 19:21:04 -04:00
trace_stat.c
trace_stat.h
trace_syscalls.c
tracing/syscalls: fix multiline in error message text
2016-09-29 10:25:23 +02:00
trace_uprobe.c
sched/headers: Prepare to use <linux/rcuupdate.h> instead of <linux/rculist.h> in <linux/sched.h>
2017-03-02 08:42:38 +01:00
tracing_map.c
tracing: Fix kmemleak in tracing_map_array_free()
2017-08-24 10:05:51 -04:00
tracing_map.h