lkml.org 
[lkml]   [2010]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/11] jump label: Base patch for jump label
* Steven Rostedt (rostedt@goodmis.org) wrote:
> On Thu, 2010-09-23 at 11:39 -0400, Jason Baron wrote:
> > On Thu, Sep 23, 2010 at 10:37:58AM -0400, Mathieu Desnoyers wrote:
>
> > I was thinking about the rcu_read_lock/synchronize_rcu() for this race.
> > We can hold the rcu_read_lock() across the is_module_text_address()
> > check in the jump label code, and then we can do in module.c:
> >
> > mod->module_init = NULL;
> > synchronize_rcu();
> > module_free(mod, mod->module_init);
>
> Um, isn't that last call the same as:
>
> module_free(mod, NULL); ?

Yes, this is incorrect (as I pointed out in my reply). We should do,
instead:

module_init = mod->module_init;
mod->module_init = NULL;
synchronize_rcu();
module_free(mod, module_init);

Thanks,

Mathieu

>
> I'll spend some time looking at this too.
>
> -- Steve
>
> > .
> > .
> > .
> >
> > or we could push the rcu_read_lock() further down into
> > is_module_address()?
> >
> > thanks,
> >
> > -Jason
> >
>
>

--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com


\
 
 \ /
  Last update: 2010-09-27 20:09    [from the cache]
©2003-2011 Jasper Spaans