x86/entry: Make IA32 syscalls' availability depend on ia32_enabled()
authorNikolay Borisov <nik.borisov@suse.com>
Fri, 23 Jun 2023 11:14:08 +0000 (14:14 +0300)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 14 Sep 2023 11:19:53 +0000 (13:19 +0200)
commit61382281e9054df523d3f9cfdba2faff88955f97
tree5b30d3598d1977deca31c5cff8619a791417eb04
parent5ae2702d7c482edbf002499e23a2e22ac4047af1
x86/entry: Make IA32 syscalls' availability depend on ia32_enabled()

Another major aspect of supporting running of 32bit processes is the
ability to access 32bit syscalls. Such syscalls can be invoked by
using the legacy int 0x80 handler and  sysenter/syscall instructions.

If IA32 emulation is disabled ensure that each of those 3 distinct
mechanisms are also disabled. For int 0x80 a #GP exception would be
generated since the respective descriptor is not going to be loaded at
all. Invoking sysenter will also result in a #GP since IA32_SYSENTER_CS
contains an invalid segment. Finally, syscall instruction cannot really
be disabled so it's configured to execute a minimal handler.

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-6-nik.borisov@suse.com
arch/x86/include/asm/proto.h
arch/x86/kernel/cpu/common.c
arch/x86/kernel/idt.c