Messages in this thread Patch in this message | | | Date | Wed, 13 Oct 2021 11:16:54 -0700 | Subject | [PATCH v5 11/15] x86, relocs: Ignore __typeid__ relocations | From | Sami Tolvanen <> |
| |
From: Kees Cook <keescook@chromium.org>
The R_X86_64_8 __typeid__* relocations are for constants the compiler generates for indirect call type checking with CONFIG_CFI_CLANG. They can be ignored during relocation generation.
Signed-off-by: Kees Cook <keescook@chromium.org> [ Sami: clarified the commit message ] Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Tested-by: Nick Desaulniers <ndesaulniers@google.com> Tested-by: Sedat Dilek <sedat.dilek@gmail.com> --- arch/x86/tools/relocs.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c index 27c82207d387..5304a6037924 100644 --- a/arch/x86/tools/relocs.c +++ b/arch/x86/tools/relocs.c @@ -51,6 +51,7 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = { "^(xen_irq_disable_direct_reloc$|" "xen_save_fl_direct_reloc$|" "VDSO|" + "__typeid__|" "__crc_)", /* @@ -811,6 +812,12 @@ static int do_reloc64(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym, symname); break; + case R_X86_64_8: + if (!shn_abs || !is_reloc(S_ABS, symname)) + die("Non-whitelisted %s relocation: %s\n", + rel_type(r_type), symname); + break; + case R_X86_64_32: case R_X86_64_32S: case R_X86_64_64: -- 2.33.0.1079.g6e70778dc9-goog
| |