Skip to content

Commit f71e1d2

Browse files
Nikolay BorisovKAGA-KOKO
authored andcommitted
x86/entry: Rename ignore_sysret()
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
1 parent 1da5c9b commit f71e1d2

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

arch/x86/entry/entry_64.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,12 +1516,12 @@ SYM_CODE_END(asm_exc_nmi)
15161516
* This handles SYSCALL from 32-bit code. There is no way to program
15171517
* MSRs to fully disable 32-bit SYSCALL.
15181518
*/
1519-
SYM_CODE_START(ignore_sysret)
1519+
SYM_CODE_START(entry_SYSCALL32_ignore)
15201520
UNWIND_HINT_END_OF_STACK
15211521
ENDBR
15221522
mov $-ENOSYS, %eax
15231523
sysretl
1524-
SYM_CODE_END(ignore_sysret)
1524+
SYM_CODE_END(entry_SYSCALL32_ignore)
15251525
#endif
15261526

15271527
.pushsection .text, "ax"

arch/x86/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static inline unsigned long cpu_kernelmode_gs_base(int cpu)
399399
return (unsigned long)per_cpu(fixed_percpu_data.gs_base, cpu);
400400
}
401401

402-
extern asmlinkage void ignore_sysret(void);
402+
extern asmlinkage void entry_SYSCALL32_ignore(void);
403403

404404
/* Save actual FS/GS selectors and bases to current->thread */
405405
void current_save_fsgs(void);

arch/x86/kernel/cpu/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2087,7 +2087,7 @@ void syscall_init(void)
20872087
(unsigned long)(cpu_entry_stack(smp_processor_id()) + 1));
20882088
wrmsrl_safe(MSR_IA32_SYSENTER_EIP, (u64)entry_SYSENTER_compat);
20892089
#else
2090-
wrmsrl_cstar((unsigned long)ignore_sysret);
2090+
wrmsrl_cstar((unsigned long)entry_SYSCALL32_ignore);
20912091
wrmsrl_safe(MSR_IA32_SYSENTER_CS, (u64)GDT_ENTRY_INVALID_SEG);
20922092
wrmsrl_safe(MSR_IA32_SYSENTER_ESP, 0ULL);
20932093
wrmsrl_safe(MSR_IA32_SYSENTER_EIP, 0ULL);

0 commit comments

Comments
 (0)