From 1fe306e4a41e802ebe39e051d6772d85a3225e54 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 17 Jul 2020 14:44:38 +0200 Subject: [PATCH] Revert "ANDROID: x86: map CFI jump tables in pti_clone_entry_text" This reverts commit 52fb2d451efb4d3ab8b4f8f14005e12a77f391ff as CFI is being removed from the tree to come back later as a "clean" set of patches. Bug: 145210207 Cc: Sami Tolvanen Signed-off-by: Greg Kroah-Hartman Change-Id: I6c8f64c167fb5544063688708a633d7f4a758559 --- arch/x86/include/asm/sections.h | 1 - arch/x86/kernel/vmlinux.lds.S | 11 ----------- arch/x86/mm/pti.c | 9 --------- 3 files changed, 21 deletions(-) diff --git a/arch/x86/include/asm/sections.h b/arch/x86/include/asm/sections.h index 5abf1301d3ff..a6e8373a5170 100644 --- a/arch/x86/include/asm/sections.h +++ b/arch/x86/include/asm/sections.h @@ -8,7 +8,6 @@ #include extern char __brk_base[], __brk_limit[]; -extern char __cfi_jt_start[], __cfi_jt_end[]; extern char __end_rodata_aligned[]; #if defined(CONFIG_X86_64) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index c7ebb71fdc94..3bfc8dd8a43d 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -144,13 +144,6 @@ SECTIONS *(.text.__x86.indirect_thunk) __indirect_thunk_end = .; #endif - -#ifdef CONFIG_CFI_CLANG - . = ALIGN(PAGE_SIZE); - __cfi_jt_start = .; - *(.text..L.cfi.jumptable .text..L.cfi.jumptable.*) - __cfi_jt_end = .; -#endif } :text =0xcccc /* End of text section, which should occupy whole number of pages */ @@ -458,7 +451,3 @@ INIT_PER_CPU(irq_stack_backing_store); "kexec control code size is too big"); #endif -#ifdef CONFIG_CFI_CLANG -. = ASSERT((__cfi_jt_end - __cfi_jt_start > 0), - "CFI jump table is empty"); -#endif diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index cb1d97580019..a8a924b3c335 100644 --- a/arch/x86/mm/pti.c +++ b/arch/x86/mm/pti.c @@ -499,15 +499,6 @@ static void pti_clone_entry_text(void) pti_clone_pgtable((unsigned long) __entry_text_start, (unsigned long) __entry_text_end, PTI_CLONE_PMD); - - /* - * If CFI is enabled, also map jump tables, so the entry code can - * make indirect calls. - */ - if (IS_ENABLED(CONFIG_CFI_CLANG)) - pti_clone_pgtable((unsigned long) __cfi_jt_start, - (unsigned long) __cfi_jt_end, - PTI_CLONE_PMD); } /*