linux/kernel/trace
Frederic Weisbecker 5be71b61f1 tracing/syscalls: protect thread flag toggling from races
Impact: fix syscall tracer enable/disable race

The current thread flag toggling is racy as shown in the following
scenario:

- task A is the last user of syscall tracing, it releases the
  TIF_SYSCALL_FTRACE on each tasks

- at the same time task B start syscall tracing. refcount == 0 so
  it sets up TIF_SYSCALL_FTRACE on each tasks.

The effect of the mixup is unpredictable.
So this fix adds a mutex on {start,stop}_syscall_tracing().

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Ingo Molnar <mingo@elte.hu>
LKML-Reference: <1237151439-6755-3-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-03-16 09:13:16 +01:00
..
blktrace.c Merge branch 'tip/tracing/ftrace' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/ftrace 2009-03-10 22:55:31 +01:00
events.c tracing: use generic __stringify 2009-03-10 00:35:05 -04:00
ftrace.c ftrace: remove struct list_head from struct dyn_ftrace 2009-03-13 11:36:20 +01:00
Kconfig tracing/ftrace: syscall tracing infrastructure, basics 2009-03-13 06:25:43 +01:00
kmemtrace.c tracing: Introduce trace_buffer_{lock_reserve,unlock_commit} 2009-02-06 01:01:41 +01:00
Makefile tracing/ftrace: syscall tracing infrastructure, basics 2009-03-13 06:25:43 +01:00
ring_buffer.c ring-buffer: document reader page design 2009-03-12 22:24:17 -04:00
trace_boot.c tracing: Introduce trace_buffer_{lock_reserve,unlock_commit} 2009-02-06 01:01:41 +01:00
trace_branch.c tracing: remove funky whitespace in the trace code 2009-03-10 14:13:14 -04:00
trace_clock.c trace_clock: fix preemption bug 2009-03-10 20:03:01 +01:00
trace_event_types.h tracing: make bprint event use the proper event id 2009-03-12 21:15:00 -04:00
trace_events_stage_1.h tracing: update comments to match event code macros 2009-03-10 13:12:58 -04:00
trace_events_stage_2.h tracing: show event name in trace for TRACE_EVENT created events 2009-03-12 22:00:19 -04:00
trace_events_stage_3.h tracing: remove funky whitespace in the trace code 2009-03-10 14:13:14 -04:00
trace_events.c tracing: have event_trace_printk use static tracer 2009-03-12 21:15:00 -04:00
trace_export.c tracing: remove funky whitespace in the trace code 2009-03-10 14:13:14 -04:00
trace_functions_graph.c tracing/core: bring back raw trace_printk for dynamic formats strings 2009-03-12 21:15:00 -04:00
trace_functions.c tracing/core: use appropriate waiting on trace_pipe 2009-02-18 01:40:20 +01:00
trace_hw_branches.c tracing/hw-branch-tracing: convert bts-tracer mutex to a spinlock 2009-02-25 09:16:01 +01:00
trace_irqsoff.c tracing: have latency tracers set the latency format 2009-03-04 22:15:30 -05:00
trace_mmiotrace.c tracing/core: bring back raw trace_printk for dynamic formats strings 2009-03-12 21:15:00 -04:00
trace_nop.c trace: Call tracing_reset_online_cpus before tracer->init() 2009-02-06 01:01:41 +01:00
trace_output.c tracing/core: bring back raw trace_printk for dynamic formats strings 2009-03-12 21:15:00 -04:00
trace_output.h tracing/core: drop the old trace_printk() implementation in favour of trace_bprintk() 2009-03-06 17:59:12 +01:00
trace_power.c tracing: convert c/p state power tracer to use tracepoints 2009-02-13 09:06:18 -05:00
trace_printk.c tracing: export trace formats to user space 2009-03-12 21:15:01 -04:00
trace_sched_switch.c tracing/core: use appropriate waiting on trace_pipe 2009-02-18 01:40:20 +01:00
trace_sched_wakeup.c tracing: have latency tracers set the latency format 2009-03-04 22:15:30 -05:00
trace_selftest_dynamic.c ftrace: fix dynamic ftrace selftest 2008-05-23 21:13:23 +02:00
trace_selftest.c tracing: use generic __stringify 2009-03-10 00:35:05 -04:00
trace_stack.c tracing: left align location header in stack_trace 2009-03-13 00:00:58 -04:00
trace_stat.c tracing: fix typing mistake in hint message and comments 2009-02-17 12:38:24 -05:00
trace_stat.h tracing/ftrace: separate events tracing and stats tracing engine 2009-01-14 12:11:37 +01:00
trace_syscalls.c tracing/syscalls: protect thread flag toggling from races 2009-03-16 09:13:16 +01:00
trace_sysprof.c tracing: make all file_operations const 2009-03-05 21:46:40 -05:00
trace_workqueue.c tracing: Don't use tracing_record_cmdline() in workqueue tracer fix 2009-03-12 21:23:47 -04:00
trace.c tracing: move binary buffers into per cpu directory 2009-03-13 00:37:42 -04:00
trace.h Merge branches 'tracing/ftrace', 'tracing/syscalls' and 'linus' into tracing/core 2009-03-16 09:12:42 +01:00