1
linux/drivers/oprofile
David Rientjes 066b3aa845 oprofile: fix race condition in event_buffer free
Looking at the 2.6.31-rc9 code, it appears there is a race condition
in the event_buffer cleanup code path (shutdown). This could lead to
kernel panic as some CPUs may be operating on the event buffer AFTER
it has been freed. The attached patch solves the problem and makes
sure CPUs check if the buffer is not NULL before they access it as
some may have been spinning on the mutex while the buffer was being
freed.

The race may happen if the buffer is freed during pending reads. But
it is not clear why there are races in add_event_entry() since all
workqueues or handlers are canceled or flushed before the event buffer
is freed.

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
2009-10-09 18:02:01 +02:00
..
buffer_sync.c cpumask: use zalloc_cpumask_var() where possible 2009-09-24 09:34:24 +09:30
buffer_sync.h cpumask: modifiy oprofile initialization 2009-01-22 14:37:06 +01:00
cpu_buffer.c x86/oprofile: introduce oprofile_add_data64() 2009-06-11 20:16:00 +02:00
cpu_buffer.h oprofile: fix uninitialized use of struct op_entry 2009-01-17 17:26:39 +01:00
event_buffer.c oprofile: fix race condition in event_buffer free 2009-10-09 18:02:01 +02:00
event_buffer.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile 2008-10-23 10:05:40 -07:00
oprof.c oprofile: Adding switch counter to oprofile statistic variables 2009-07-20 16:43:21 +02:00
oprof.h oprofile: Rename variable timeout_jiffies and move to oprofile_files.c 2009-07-20 16:43:19 +02:00
oprofile_files.c oprofile: Remove oprofile_multiplexing_init() 2009-07-20 16:43:19 +02:00
oprofile_stats.c oprofile: Adding switch counter to oprofile statistic variables 2009-07-20 16:43:21 +02:00
oprofile_stats.h oprofile: Adding switch counter to oprofile statistic variables 2009-07-20 16:43:21 +02:00
oprofilefs.c const: mark remaining super_operations const 2009-09-22 07:17:24 -07:00
timer_int.c oprofile: fixing whitespaces in drivers/oprofile/* 2008-10-16 15:01:40 +02:00