kpatch/kpatch-build
Josh Poimboeuf 687e2caabc create-diff-object: Don't strip callback section symbols
Internal CI is reporting a SIGSEGV in create-diff-object when it
processes macro-callbacks.patch, starting with 19baa5b7c7
("create-diff-object: process debug sections last").

The problem is that, after changing the order between callback and debug
section inclusion, kpatch_include_debug_sections() now tries to include
the callback section symbols.  But kpatch_include_callback_elements()
inadvertently un-includes the callback section symbols (e.g.,
".kpatch.callbacks.pre_patch") when it un-includes the callback struct
symbols (e.g., "kpatch_pre_patch_data").

So after kpatch_elf_teardown(kelf_patched), the callback section symbols
get freed even though there are DWARF .debug_info relocations which
reference them.  Then kpatch_check_relocations() goes off into the weeds
when it accesses one of the freed symbols.

Fix it by refining the callback un-include logic so that it *only*
strips the struct object symbols.

Fixes: 19baa5b7c7 ("create-diff-object: process debug sections last")
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2020-02-18 10:16:39 -06:00
..
gcc-plugins gcc-plugin: Include additional header for GCC 8 2018-05-30 19:39:48 +05:30
insn insn: get it to compile in create-diff-object 2014-05-30 15:19:57 -05:00
create-diff-object.c create-diff-object: Don't strip callback section symbols 2020-02-18 10:16:39 -06:00
create-klp-module.c create-klp-module: Fix -Wconversion warnings 2020-02-11 19:25:04 +05:30
create-kpatch-module.c create-kpatch-module: Fix -Wconversion warnings 2020-02-11 19:25:10 +05:30
kpatch-build kpatch-build: replace all '-' to '_' in KOBJFILE_NAME 2019-12-30 17:48:14 +08:00
kpatch-elf.c kpatch-elf: Fix -Wconversion warnings 2020-02-11 19:24:57 +05:30
kpatch-elf.h create-diff-object: fix relocations used for ZERO_PAGE(0) 2020-01-20 11:41:01 +03:00
kpatch-gcc Making kpatch-build compatible with custom gcc names 2019-05-09 19:15:11 +02:00
kpatch-intermediate.h create-diff-object: Fix -Wconversion warnings 2020-02-10 09:07:21 +05:30
kpatch.h kpatch-build: add exit status enum 2018-06-15 07:11:48 -04:00
list.h new .fixup group size algorithm 2014-09-15 14:54:57 -05:00
log.h kpatch-build: add exit status enum 2018-06-15 07:11:48 -04:00
lookup.c Make symvers reading code more flexible. 2019-10-25 14:17:11 +02:00
lookup.h kpatch-build: use symbol table instead of kobject 2018-05-18 09:24:40 +02:00
Makefile kpatch-build/Makefile: Skip build insn/plugin with -Wconversion 2020-01-23 12:59:38 +05:30