This is a note to let you know that I've just added the patch titled
ring-buffer: Check for uninitialized cpu buffer before resizing
to the 3.6-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ring-buffer-check-for-uninitialized-cpu-buffer-before-resizing.patch
and it can be found in the queue-3.6 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 8e49f418c9632790bf456634742d34d97120a784 Mon Sep 17 00:00:00 2001
From: Vaibhav Nagarnaik <[email protected]>
Date: Wed, 10 Oct 2012 16:40:27 -0700
Subject: ring-buffer: Check for uninitialized cpu buffer before resizing
From: Vaibhav Nagarnaik <[email protected]>
commit 8e49f418c9632790bf456634742d34d97120a784 upstream.
With a system where, num_present_cpus < num_possible_cpus, even if all
CPUs are online, non-present CPUs don't have per_cpu buffers allocated.
If per_cpu/<cpu>/buffer_size_kb is modified for such a CPU, it can cause
a panic due to NULL dereference in ring_buffer_resize().
To fix this, resize operation is allowed only if the per-cpu buffer has
been initialized.
Link:
http://lkml.kernel.org/r/[email protected]
Signed-off-by: Vaibhav Nagarnaik <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
kernel/trace/ring_buffer.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -1567,6 +1567,10 @@ int ring_buffer_resize(struct ring_buffe
put_online_cpus();
} else {
+ /* Make sure this CPU has been intitialized */
+ if (!cpumask_test_cpu(cpu_id, buffer->cpumask))
+ goto out;
+
cpu_buffer = buffer->buffers[cpu_id];
if (nr_pages == cpu_buffer->nr_pages)
Patches currently in stable-queue which might be from [email protected] are
queue-3.6/ring-buffer-check-for-uninitialized-cpu-buffer-before-resizing.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html