summaryrefslogtreecommitdiffstats
path: root/security/security.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-05-08 17:01:03 -0700
committerJosh Poimboeuf <jpoimboe@redhat.com>2021-10-06 20:11:57 -0700
commit86e1e054e0d2105cf32b0266cf1a64e6c26424f7 (patch)
tree307354a08cc0e5c4c0fa9968b9b7bf84010104be /security/security.c
parentb46179d6bb3182c020f2bf9bb4df6ba5463b0495 (diff)
downloadlinux-stable-86e1e054e0d2105cf32b0266cf1a64e6c26424f7.tar.gz
linux-stable-86e1e054e0d2105cf32b0266cf1a64e6c26424f7.tar.bz2
linux-stable-86e1e054e0d2105cf32b0266cf1a64e6c26424f7.zip
objtool: Update section header before relocations
The libelf implementation from elftoolchain has a safety check in gelf_update_rel[a] to check that the data corresponds to a section that has type SHT_REL[A] [0]. If the relocation is updated before the section header is updated with the proper type, this check fails. To fix this, update the section header first, before the relocations. Previously, the section size was calculated in elf_rebuild_reloc_section by counting the number of entries in the reloc_list. However, we now need the size during elf_write so instead keep a running total and add to it for every new relocation. [0] https://sourceforge.net/p/elftoolchain/mailman/elftoolchain-developers/thread/CAGw6cBtkZro-8wZMD2ULkwJ39J+tHtTtAWXufMjnd3cQ7XG54g@mail.gmail.com/ Signed-off-by: Michael Forney <mforney@mforney.org> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: https://lore.kernel.org/r/20210509000103.11008-2-mforney@mforney.org
Diffstat (limited to 'security/security.c')
0 files changed, 0 insertions, 0 deletions