Re: [PATCH] module: fix refptr allocation and release order

From: Rusty Russell
Date: Tue Mar 17 2009 - 17:22:17 EST


On Tuesday 17 March 2009 13:54:36 Eric Dumazet wrote:
> Rusty Russell a Ãcrit :
> > From: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
> >
> > Impact: fix ref-after-free crash on failed module load
> >
> > Fix refptr bug: Change refptr allocation and release order not to access a module
> > data structure pointed by 'mod' after freeing mod->module_core.
> > This bug will cause kernel panic(e.g. failed to find undefined symbols).
> >
> > This bug was reported on systemtap bugzilla.
> > http://sources.redhat.com/bugzilla/show_bug.cgi?id=9927
> >
> > Signed-off-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
> > Cc: Eric Dumazet <dada1@xxxxxxxxxxxxx>
> > Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
>
>
> My original patch did not have this problem, because I used a local variable
> to hold refptr.
>
> http://www.archivum.info/linux-kernel@xxxxxxxxxxxxxxx/2008-05/msg07400.html
>
> A simpler patch could just use a local variable again, since we are very
> late in rc phase ?

Right, it was my mistake. But the extra #ifdef is still ugly: moving the code
is a larger patch, but it's not complicated.

Thanks,
Rusty.
--
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/