x86/entry: Rename ignore_sysret()
authorNikolay Borisov <nik.borisov@suse.com>
Fri, 23 Jun 2023 11:14:05 +0000 (14:14 +0300)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 14 Sep 2023 11:19:53 +0000 (13:19 +0200)
The SYSCALL instruction cannot really be disabled in compatibility mode.
The best that can be done is to configure the CSTAR msr to point to a
minimal handler. Currently this handler has a rather misleading name -
ignore_sysret() as it's not really doing anything with sysret.

Give it a more descriptive name.

Signed-off-by: Nikolay Borisov <nik.borisov@suse.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230623111409.3047467-3-nik.borisov@suse.com
arch/x86/entry/entry_64.S
arch/x86/include/asm/processor.h
arch/x86/kernel/cpu/common.c

index 43606de225117d1ccd1d776791b43d3022b8a4a0..3be71accb7a0600b46311aac0a6a3af64022c39b 100644 (file)
@@ -1516,12 +1516,12 @@ SYM_CODE_END(asm_exc_nmi)
  * This handles SYSCALL from 32-bit code.  There is no way to program
  * MSRs to fully disable 32-bit SYSCALL.
  */
-SYM_CODE_START(ignore_sysret)
+SYM_CODE_START(entry_SYSCALL32_ignore)
        UNWIND_HINT_END_OF_STACK
        ENDBR
        mov     $-ENOSYS, %eax
        sysretl
-SYM_CODE_END(ignore_sysret)
+SYM_CODE_END(entry_SYSCALL32_ignore)
 #endif
 
 .pushsection .text, "ax"
index 0086920cda061f83f2050822646bfadbc0f474bc..93cd28d6f3176f0b719a41ca69120f6fe89a14e3 100644 (file)
@@ -399,7 +399,7 @@ static inline unsigned long cpu_kernelmode_gs_base(int cpu)
        return (unsigned long)per_cpu(fixed_percpu_data.gs_base, cpu);
 }
 
-extern asmlinkage void ignore_sysret(void);
+extern asmlinkage void entry_SYSCALL32_ignore(void);
 
 /* Save actual FS/GS selectors and bases to current->thread */
 void current_save_fsgs(void);
index 382d4e6b848d20f1d927f8687d1e8806acf8ea3d..b3f8cba21353edb238d9d2e66afaae17ba08f86d 100644 (file)
@@ -2087,7 +2087,7 @@ void syscall_init(void)
                    (unsigned long)(cpu_entry_stack(smp_processor_id()) + 1));
        wrmsrl_safe(MSR_IA32_SYSENTER_EIP, (u64)entry_SYSENTER_compat);
 #else
-       wrmsrl_cstar((unsigned long)ignore_sysret);
+       wrmsrl_cstar((unsigned long)entry_SYSCALL32_ignore);
        wrmsrl_safe(MSR_IA32_SYSENTER_CS, (u64)GDT_ENTRY_INVALID_SEG);
        wrmsrl_safe(MSR_IA32_SYSENTER_ESP, 0ULL);
        wrmsrl_safe(MSR_IA32_SYSENTER_EIP, 0ULL);