diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-01-06 20:40:44 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-01-06 20:40:44 -0500 |
commit | 0e1ff5d72a6393f2ef5dbf74f58bb55a12d63834 (patch) | |
tree | e9a9600a14fa4d1f2b045097c9e9d7d03463f0bf /kernel/trace/ring_buffer.c | |
parent | 5ded3dc6a3c7549b36a8ac27bbd81b33756a2c29 (diff) | |
download | op-kernel-dev-0e1ff5d72a6393f2ef5dbf74f58bb55a12d63834.zip op-kernel-dev-0e1ff5d72a6393f2ef5dbf74f58bb55a12d63834.tar.gz |
ring-buffer: Add rb_list_head() wrapper around new reader page next field
If the very unlikely case happens where the writer moves the head by one
between where the head page is read and where the new reader page
is assigned _and_ the writer then writes and wraps the entire ring buffer
so that the head page is back to what was originally read as the head page,
the page to be swapped will have a corrupted next pointer.
Simple solution is to wrap the assignment of the next pointer with a
rb_list_head().
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/ring_buffer.c')
-rw-r--r-- | kernel/trace/ring_buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index d5b7308..edefe3b 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -2869,7 +2869,7 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer) * Splice the empty reader page into the list around the head. */ reader = rb_set_head_page(cpu_buffer); - cpu_buffer->reader_page->list.next = reader->list.next; + cpu_buffer->reader_page->list.next = rb_list_head(reader->list.next); cpu_buffer->reader_page->list.prev = reader->list.prev; /* |