From 517e26a6cb3ffacfd3e13b702856448c16cd8285 Mon Sep 17 00:00:00 2001 From: Zhipeng Xie Date: Thu, 22 Nov 2018 21:06:32 +0000 Subject: [PATCH] kpatch-build: include secsym in kpatch_mark_ignored_sections kpatch_mark_ignored_sections include .rodata.str1.1 section but does not include its section symbol, causing its section symbol can not be included any more in kpatch_include_standard_elements. After the section symbol is freed in kpatch_elf_teardown, we got a segmentation fault in kpatch_create_intermediate_sections. Signed-off-by: Zhipeng Xie --- kpatch-build/create-diff-object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c index e167890..5384b5f 100644 --- a/kpatch-build/create-diff-object.c +++ b/kpatch-build/create-diff-object.c @@ -2246,6 +2246,7 @@ static void kpatch_mark_ignored_sections(struct kpatch_elf *kelf) * from the section data comparison, but this is a simpler way. */ strsec->include = 1; + strsec->secsym->include = 1; name = strsec->data->d_buf + rela->addend; ignoresec = find_section_by_name(&kelf->sections, name); if (!ignoresec)