lkml.org 
[lkml]   [2009]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] oprofile: fix race condition in event_buffer free

* Robert Richter <robert.richter@amd.com> wrote:

> On 09.10.09 21:33:29, Robert Richter wrote:
> > From: David Rientjes <rientjes@google.com>
> >
> > 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>
>
> Ingo,
>
> you can also pull the patches from here:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile.git urgent
>
> Thanks.

Pulled, thanks Robert!

Ingo


\
 
 \ /
  Last update: 2009-10-12 23:49    [W:0.054 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site