diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-03-12 19:48:41 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-01 19:01:17 -0400 |
commit | 70e27dedd11fdbb3a9dec79af59d8ba61a19365b (patch) | |
tree | ceeebb9871a93301e09b1c829b87bcea58e69338 /kernel/ptrace.c | |
parent | fe030f50c598ffd9476da37d35a7dd7301487795 (diff) |
tracing: Use same local variable when resetting the ring buffer
commit 283740c619d211e34572cc93c8cdba92ccbdb9cc upstream.
In the ftrace code that resets the ring buffer it references the
buffer with a local variable, but then uses the tr->buffer as the
parameter to reset. If the wakeup tracer is running, which can
switch the tr->buffer with the max saved buffer, this can break
the requirement of disabling the buffer before the reset.
buffer = tr->buffer;
ring_buffer_record_disable(buffer);
synchronize_sched();
__tracing_reset(tr->buffer, cpu);
If the tr->buffer is swapped, then the reset is not happening to the
buffer that was disabled. This will cause the ring buffer to fail.
Found with Li Zefan's ftrace_stress_test.
Reported-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/ptrace.c')
0 files changed, 0 insertions, 0 deletions