Skip to content

Commit c432a02

Browse files
pvts-matPlaidCat
authored andcommitted
x86/entry: Rename ignore_sysret()
jira VULN-772 cve-pre CVE-2024-25744 commit-author Nikolay Borisov <nik.borisov@suse.com> commit f71e1d2 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 (cherry picked from commit f71e1d2) Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
1 parent 04db3df commit c432a02

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

arch/x86/entry/entry_64.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,12 +1503,12 @@ SYM_CODE_END(asm_exc_nmi)
15031503
* This handles SYSCALL from 32-bit code. There is no way to program
15041504
* MSRs to fully disable 32-bit SYSCALL.
15051505
*/
1506-
SYM_CODE_START(ignore_sysret)
1506+
SYM_CODE_START(entry_SYSCALL32_ignore)
15071507
UNWIND_HINT_EMPTY
15081508
ENDBR
15091509
mov $-ENOSYS, %eax
15101510
sysretl
1511-
SYM_CODE_END(ignore_sysret)
1511+
SYM_CODE_END(entry_SYSCALL32_ignore)
15121512
#endif
15131513

15141514
.pushsection .text, "ax"

arch/x86/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ static inline unsigned long cpu_kernelmode_gs_base(int cpu)
461461

462462
DECLARE_PER_CPU(void *, hardirq_stack_ptr);
463463
DECLARE_PER_CPU(bool, hardirq_stack_inuse);
464-
extern asmlinkage void ignore_sysret(void);
464+
extern asmlinkage void entry_SYSCALL32_ignore(void);
465465

466466
/* Save actual FS/GS selectors and bases to current->thread */
467467
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
@@ -2025,7 +2025,7 @@ void syscall_init(void)
20252025
(unsigned long)(cpu_entry_stack(smp_processor_id()) + 1));
20262026
wrmsrl_safe(MSR_IA32_SYSENTER_EIP, (u64)entry_SYSENTER_compat);
20272027
#else
2028-
wrmsrl(MSR_CSTAR, (unsigned long)ignore_sysret);
2028+
wrmsrl(MSR_CSTAR, (unsigned long)entry_SYSCALL32_ignore);
20292029
wrmsrl_safe(MSR_IA32_SYSENTER_CS, (u64)GDT_ENTRY_INVALID_SEG);
20302030
wrmsrl_safe(MSR_IA32_SYSENTER_ESP, 0ULL);
20312031
wrmsrl_safe(MSR_IA32_SYSENTER_EIP, 0ULL);

0 commit comments

Comments
 (0)