mirror of
https://github.com/dynup/kpatch
synced 2025-01-28 15:52:43 +00:00
create-diff-object: fix for unincluded sec->secsym
When running kpatch-build with -d, I was getting a seg fault. It was faulting in kpatch_dump_kelf() when trying to print sec->secsym->name for the .smp_locks section. It turns out that the section was included but its section symbol wasn't included, so sec->secsym pointed to freed memory.
This commit is contained in:
parent
6f38498d95
commit
4fefa662fd
@ -1134,6 +1134,9 @@ void kpatch_migrate_included_elements(struct kpatch_elf *kelf, struct kpatch_elf
|
||||
list_del(&sec->list);
|
||||
list_add_tail(&sec->list, &out->sections);
|
||||
sec->index = 0;
|
||||
if (!is_rela_section(sec) && sec->secsym && !sec->secsym->include)
|
||||
/* break link to non-included section symbol */
|
||||
sec->secsym = NULL;
|
||||
}
|
||||
|
||||
/* migrate included symbols from kelf to out */
|
||||
|
Loading…
Reference in New Issue
Block a user