Skip to content

Commit

Permalink
create-diff-object: keep ubsan section
Browse files Browse the repository at this point in the history
If CONFIG_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 Jan 9, 2023
1 parent d01cbc2 commit d5888f2
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 @@ -1688,6 +1688,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 @@ -1851,7 +1852,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 @@ -1947,6 +1949,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 d5888f2

Please sign in to comment.