Skip to content

Commit

Permalink
WIP: create-diff-object: keep ubsan section
Browse files Browse the repository at this point in the history
If CONIFIG_UBSAN is enabled, ubsan section (.data..Lubsan_{data,type})
can be created. Keep them unconditionally.

NOTE: This patch needs to be verified.

Signed-off-by: Misono Tomohiro <[email protected]>
  • Loading branch information
t-msn authored and swine committed Oct 11, 2022
1 parent be7587c commit 7352145
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kpatch-build/create-diff-object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,7 @@ static void kpatch_replace_sections_syms(struct kpatch_elf *kelf)
!strcmp(rela->sym->name, ".fixup") ||
!strcmp(rela->sym->name, ".altinstr_replacement") ||
!strcmp(rela->sym->name, ".altinstr_aux") ||
!strncmp(rela->sym->name, ".data..Lubsan", 13) ||
!strcmp(rela->sym->name, ".text..refcount"))
continue;

Expand Down Expand Up @@ -1819,7 +1820,8 @@ static void kpatch_verify_patchability(struct kpatch_elf *kelf)
(!strncmp(sec->name, ".data", 5) ||
!strncmp(sec->name, ".bss", 4)) &&
!is_data_once_section(sec->name) &&
!is_data_unlikely_section(sec->name)) {
!is_data_unlikely_section(sec->name) &&
strncmp(sec->name, ".data..Lubsan", 13)) {
log_normal("data section %s selected for inclusion\n",
sec->name);
errs++;
Expand Down Expand Up @@ -1915,6 +1917,7 @@ static void kpatch_include_standard_elements(struct kpatch_elf *kelf)
!strcmp(sec->name, ".symtab") ||
!strcmp(sec->name, ".toc") ||
!strcmp(sec->name, ".rodata") ||
!strncmp(sec->name, ".data..Lubsan", 13) ||
is_string_literal_section(sec)) {
kpatch_include_section(sec);
}
Expand Down

0 comments on commit 7352145

Please sign in to comment.