Re: Patch: module-init-tools-0.6/modprobe.c - support subdirectories

From: Rusty Russell (rusty@rustcorp.com.au)
Date: Tue Nov 19 2002 - 16:34:36 EST


In message <20021119145502.B5535@flint.arm.linux.org.uk> you write:
> On Tue, Nov 19, 2002 at 05:42:38PM +1100, Rusty Russell wrote:
> > A: The total linking code is about 200 generic lines, 100
> > x86-specific lines.
>
> Should we be bounds-checking the relocations? Maybe we are (I'm not
> familiar enough with this new module code yet.) I'm specifically
> thinking about the following:
>
> /* This is where to make the change */
> location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_offset
> + rel[i].r_offset;
> /* This is the symbol it is referring to */
> sym = (Elf32_Sym *)sechdrs[symindex].sh_offset
> + ELF32_R_SYM(rel[i].r_info);
> if (!sym->st_value) {

No, you didn't miss anything: I do minimal checking. I figured it was
worth preventing mistakes (eg. insmod randomcrap.o), but in the end
you're going to trust the module.

I'd say definitely if you know that it has happened (eg. binutils bugs
or something).

Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Nov 23 2002 - 22:00:30 EST