]> asedeno.scripts.mit.edu Git - linux.git/commit
x86/tools/relocs: Fix big section header tables
authorArtem Savkov <asavkov@redhat.com>
Thu, 29 Nov 2018 15:56:15 +0000 (16:56 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 19 Apr 2019 18:54:07 +0000 (20:54 +0200)
commitf36e7495dd3990d6848e6d6703c78f1f17a97538
tree915ca0fded734ef601f16cbc98fa3d34b6474aa6
parent93ddedaa5c9cb828d39a19b5d6e7e1939393085a
x86/tools/relocs: Fix big section header tables

In case when the number of entries in the section header table is larger
then or equal to SHN_LORESERVE the size of the table is held in the sh_size
member of the initial entry in section header table instead of e_shnum.
Same with the string table index which is located in sh_link instead of
e_shstrndx.

This case is easily reproducible with KCFLAGS="-ffunction-sections",
bzImage build fails with "String table index out of bounds" error.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Cc: Eric W . Biederman <ebiederm@xmission.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20181129155615.2594-1-asavkov@redhat.com
[ Simplify the die() lines. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/tools/relocs.c