mirror of
https://github.com/dynup/kpatch
synced 2024-12-21 04:39:57 +00:00
305ff8a5d8
A seg fault was reported: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7f18c8e in __strcmp_avx2 () from /lib64/libc.so.6 Missing separate debuginfos, use: dnf debuginfo-install elfutils-libelf-0.186-1.fc34.x86_64 zlib-1.2.11-26.fc34.x86_64 (gdb) bt #0 0x00007ffff7f18c8e in __strcmp_avx2 () from /lib64/libc.so.6 #1 0x000000000040a0f7 in kpatch_is_core_module_symbol (name=0x0) at create-diff-object.c:3060 #2 0x000000000040a267 in need_dynrela (kelf=0x4669a0, table=0x92af30, sec=0x6d6b20, rela=0x8c7fd0) at create-diff-object.c:3117 #3 0x000000000040a4cc in kpatch_create_intermediate_sections (kelf=0x4669a0, table=0x92af30, objname=0x7fffffffcfc6 "vmlinux", pmod_name=0x7fffffffd020 "livepatch_a") at create-diff-object.c:3281 #4 0x000000000040c7c5 in main (argc=8, argv=0x7fffffffca48) at create-diff-object.c:3931 It happened because 'rela->sym->name' was NULL, and kpatch_is_core_module_symbol() tried to dereference it. Here's the corresponding relocation: Relocation section [455] '.rela.debug_loclists' for section [454] '.debug_loclists' at offset 0xd0478 contains 2432 entries: Offset Type Value Addend Name ... 0x000000000000aad6 X86_64_64 000000000000000000 +32 .LC55 ... That '.LC55' symbol lives in the following section: [104] .rodata.btf_show_end_aggr_type.str1.8 PROGBITS 0000000000000000 00003ef0 00000021 1 AMS 0 0 8 The problem is that the symbol wasn't included in the output file (though its corresponding section was). So it got zeroed by kpatch_elf_teardown(), which was designed to trigger seg faults to help find bugs like this. The string literal sections which hold the '.LCx' string symbols are already being included. Include their symbols as well. Fixes #1257. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> |
||
---|---|---|
.. | ||
gcc-plugins | ||
insn | ||
create-diff-object.c | ||
create-klp-module.c | ||
create-kpatch-module.c | ||
kpatch-build | ||
kpatch-cc | ||
kpatch-elf.c | ||
kpatch-elf.h | ||
kpatch-intermediate.h | ||
kpatch.h | ||
list.h | ||
log.h | ||
lookup.c | ||
lookup.h | ||
Makefile |