Re: [RFC][PATCH] Prevent overriding of Symbols in the Kernel,avoiding Undefined behaviour

From: Rusty Russell
Date: Thu Dec 15 2005 - 00:14:25 EST


On Wed, 2005-12-14 at 20:40 -0800, Andrew Morton wrote:
> Ashutosh Naik <ashutosh.naik@xxxxxxxxx> wrote:
> >
> > This patch ensures that an exported symbol does not already exist in
> > the kernel or in some other module's exported symbol table. This is
> > done by checking the symbol tables for the exported symbol at the time
> > of loading the module. Currently this is done after the relocation of
> > the symbol.
>
> This patch causes weird things to happen on ppc64.

And probably in general:

+ for (i = 0; i < mod->num_syms; i++)
+ if (!__find_symbol(mod->syms[i].name, &owner, &crc, 1)) {
+ name = mod->syms[i].name;
+ ret = -ENOEXEC;
+ goto dup;

__find_symbol returns the value, or 0 on failure. This test is
backwards, as is the one below it.

Rusty.
--
ccontrol: http://ozlabs.org/~rusty/ccontrol

-
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/