linux/scripts/mod
Krzysztof Halasa 1c938663d5 kbuild: Fix modpost segfault
Alan <alan@clueserver.org> writes:

> program: /home/alan/GitTrees/linux-2.6-mid-ref/scripts/mod/modpost -o
> Module.symvers -S vmlinux.o
>
> Program received signal SIGSEGV, Segmentation fault.

It just hit me.
It's the offset calculation in reloc_location() which overflows:
        return (void *)elf->hdr + sechdrs[section].sh_offset +
               (r->r_offset - sechdrs[section].sh_addr);

E.g. for the first rodata r entry:
r->r_offset < sechdrs[section].sh_addr
and the expression in the parenthesis produces 0xFFFFFFE0 or something
equally wise.

Reported-by: Alan <alan@clueserver.org>
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Tested-by: Alan <alan@clueserver.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-06-12 00:21:58 +02:00
..
.gitignore
Makefile module: make MODULE_SYMBOL_PREFIX into a CONFIG option 2009-12-15 16:28:26 +10:30
empty.c
file2alias.c Merge branch 'modules' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus 2010-05-21 17:15:44 -07:00
mk_elfconfig.c module: make MODULE_SYMBOL_PREFIX into a CONFIG option 2009-12-15 16:28:26 +10:30
modpost.c kbuild: Fix modpost segfault 2010-06-12 00:21:58 +02:00
modpost.h Kbuild: clear marker out of modpost 2009-12-15 16:28:31 +10:30
sumversion.c trivial: remove references to non-existent include/linux/config.h 2009-09-21 15:14:52 +02:00