Re: [PATCH 03/11] jump label: Base patch for jump label

From: Mathieu Desnoyers
Date: Thu Sep 23 2010 - 13:14:35 EST


* Steven Rostedt (rostedt@xxxxxxxxxxx) 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/