diff options
author | David Rientjes <rientjes@google.com> | 2009-09-09 15:02:33 +0200 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2009-10-09 18:02:01 +0200 |
commit | 066b3aa8454bee3cdc665d86b5de812d8d0513b3 (patch) | |
tree | 5005ac2eba0190371c21d88af286ecff267a229c /drivers/message | |
parent | 374576a8b6f865022c0fd1ca62396889b23d66dd (diff) |
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>
Diffstat (limited to 'drivers/message')
0 files changed, 0 insertions, 0 deletions