summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cet.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/cet.c')
-rw-r--r--arch/x86/kernel/cet.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/arch/x86/kernel/cet.c b/arch/x86/kernel/cet.c
index cc10d8be9d74..d2c732a34e5d 100644
--- a/arch/x86/kernel/cet.c
+++ b/arch/x86/kernel/cet.c
@@ -81,9 +81,6 @@ static void do_user_cp_fault(struct pt_regs *regs, unsigned long error_code)
static __ro_after_init bool ibt_fatal = true;
-/* code label defined in asm below */
-extern void ibt_selftest_ip(void);
-
static void do_kernel_cp_fault(struct pt_regs *regs, unsigned long error_code)
{
if ((error_code & CP_EC) != CP_ENDBR) {
@@ -91,7 +88,7 @@ static void do_kernel_cp_fault(struct pt_regs *regs, unsigned long error_code)
return;
}
- if (unlikely(regs->ip == (unsigned long)&ibt_selftest_ip)) {
+ if (unlikely(regs->ip == (unsigned long)&ibt_selftest_noendbr)) {
regs->ax = 0;
return;
}
@@ -105,24 +102,6 @@ static void do_kernel_cp_fault(struct pt_regs *regs, unsigned long error_code)
BUG();
}
-/* Must be noinline to ensure uniqueness of ibt_selftest_ip. */
-noinline bool ibt_selftest(void)
-{
- unsigned long ret;
-
- asm (" lea ibt_selftest_ip(%%rip), %%rax\n\t"
- ANNOTATE_RETPOLINE_SAFE
- " jmp *%%rax\n\t"
- "ibt_selftest_ip:\n\t"
- UNWIND_HINT_FUNC
- ANNOTATE_NOENDBR
- " nop\n\t"
-
- : "=a" (ret) : : "memory");
-
- return !ret;
-}
-
static int __init ibt_setup(char *str)
{
if (!strcmp(str, "off"))