diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2010-11-26 13:42:47 +0100 |
---|---|---|
committer | AK <andi@firstfloor.org> | 2011-02-06 11:03:40 -0800 |
commit | 78dd4b02b5d68c4d64557152a35941150f90ff82 (patch) | |
tree | aae1bfb3712deba7efba605ca8cd33e07856f22e /net/iucv | |
parent | 89c24ec0eee40272f0387eeb6a6cc31e6bbc1544 (diff) |
printk: Fix wake_up_klogd() vs cpu hotplug
commit 49f4138346b3cec2706adff02658fe27ceb1e46f upstream.
wake_up_klogd() may get called from preemptible context but uses
__raw_get_cpu_var() to write to a per cpu variable. If it gets preempted
between getting the address and writing to it, the cpu in question could be
offline if the process gets scheduled back and hence writes to the per cpu data
of an offline cpu.
This buggy behaviour was introduced with fa33507a "printk: robustify
printk, fix #2" which was supposed to fix a "using smp_processor_id() in
preemptible" warning.
Let's use this_cpu_write() instead which disables preemption and makes sure
that the outlined scenario cannot happen.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <20101126124247.GC7023@osiris.boeblingen.de.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net/iucv')
0 files changed, 0 insertions, 0 deletions