diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-10-14 10:44:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-11 09:35:53 -0800 |
commit | 12cb3e734a5616ea0057aee938c553ff6ccbdfbd (patch) | |
tree | 828c560746757c997c97a76777444a036a5ef9ac /lib/extable.c | |
parent | d59892017c5f6de2fdee221f2a7788696e9f2cda (diff) | |
download | kernel_samsung_espresso10-12cb3e734a5616ea0057aee938c553ff6ccbdfbd.zip kernel_samsung_espresso10-12cb3e734a5616ea0057aee938c553ff6ccbdfbd.tar.gz kernel_samsung_espresso10-12cb3e734a5616ea0057aee938c553ff6ccbdfbd.tar.bz2 |
tracing: Fix returning of duplicate data after EOF in trace_pipe_raw
commit 436fc280261dcfce5af38f08b89287750dc91cd2 upstream.
The trace_pipe_raw handler holds a cached page from the time the file
is opened to the time it is closed. The cached page is used to handle
the case of the user space buffer being smaller than what was read from
the ring buffer. The left over buffer is held in the cache so that the
next read will continue where the data left off.
After EOF is returned (no more data in the buffer), the index of
the cached page is set to zero. If a user app reads the page again
after EOF, the check in the buffer will see that the cached page
is less than page size and will return the cached page again. This
will cause reading the trace_pipe_raw again after EOF to return
duplicate data, making the output look like the time went backwards
but instead data is just repeated.
The fix is to not reset the index right after all data is read
from the cache, but to reset it after all data is read and more
data exists in the ring buffer.
Reported-by: Jeremy Eder <jeder@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib/extable.c')
0 files changed, 0 insertions, 0 deletions