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
..
2005-04-16 15:20:36 -07:00
2010-06-12 00:21:58 +02:00
2005-04-16 15:20:36 -07:00
2007-12-17 19:28:17 -08:00
2010-03-07 21:19:09 +01:00
2010-03-07 21:22:56 +01:00
2008-07-25 22:12:41 +02:00
2009-06-09 22:37:54 +02:00
2010-03-23 12:26:38 +01:00
2009-09-15 17:04:38 -07:00
2008-04-25 20:18:48 +02:00
2008-04-25 20:18:48 +02:00
2009-09-18 21:22:08 +02:00
2005-04-16 15:20:36 -07:00
2010-03-07 21:38:32 +01:00
2009-06-09 22:37:54 +02:00