[PATCH] strip: Verify symbol table is a real symbol table
Aaron Merey
amerey@redhat.com
Thu Feb 13 20:37:34 GMT 2025
Hi Mark,
On Thu, Feb 13, 2025 at 9:04 AM Mark Wielaard <mark@klomp.org> wrote:
>
> We didn't check the symbol table referenced from the relocation table
> was a real symbol table. This could cause a crash if that section
> happened to be an SHT_NOBITS section without any data. Fix this by
> adding an explicit check.
>
> * src/strip.c (INTERNAL_ERROR_MSG): New macro that takes a
> message string to display.
> (INTERNAL_ERROR): Use INTERNAL_ERROR_MSG with elf_errmsg (-1).
> (remove_debug_relocations): Check the sh_link referenced
> section is real and isn't a SHT_NOBITS section.
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=32673
>
> Signed-off-by: Mark Wielaard <mark@klomp.org>
LGTM.
Aaron
More information about the Elfutils-devel
mailing list