linux-stable/arch
Sean Christopherson eb1a542824 KVM: x86: Disallow KVM_SET_SREGS{2} if incoming CR0 is invalid
commit 26a0652cb4 upstream.

Reject KVM_SET_SREGS{2} with -EINVAL if the incoming CR0 is invalid,
e.g. due to setting bits 63:32, illegal combinations, or to a value that
isn't allowed in VMX (non-)root mode.  The VMX checks in particular are
"fun" as failure to disallow Real Mode for an L2 that is configured with
unrestricted guest disabled, when KVM itself has unrestricted guest
enabled, will result in KVM forcing VM86 mode to virtual Real Mode for
L2, but then fail to unwind the related metadata when synthesizing a
nested VM-Exit back to L1 (which has unrestricted guest enabled).

Opportunistically fix a benign typo in the prototype for is_valid_cr4().

Cc: stable@vger.kernel.org
Reported-by: syzbot+5feef0b9ee9c8e9e5689@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/000000000000f316b705fdf6e2b4@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20230613203037.1968489-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-03 10:24:08 +02:00
..
alpha mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
arc ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard 2023-07-19 16:21:42 +02:00
arm ARM: orion5x: fix d2net gpio initialization 2023-07-19 16:22:14 +02:00
arm64 arm64: errata: Mitigate Ampere1 erratum AC03_CPU_38 at stage-2 2023-08-03 10:23:54 +02:00
csky csky: fix up lock_mm_and_find_vma() conversion 2023-07-01 13:16:27 +02:00
hexagon mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
ia64 mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
loongarch mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
m68k mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
microblaze mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
mips MIPS: Loongson: Fix build error when make modules_install 2023-08-03 10:23:50 +02:00
nios2 mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
openrisc mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
parisc parisc: fix expand_stack() conversion 2023-07-01 13:16:26 +02:00
powerpc powerpc/pseries/vas: Hold mmap_mutex after mmap lock during window close 2023-08-03 10:23:48 +02:00
riscv riscv: mm: fix truncation warning on RV32 2023-07-23 13:49:26 +02:00
s390 KVM: s390: pv: fix index value of replaced ASCE 2023-08-03 10:23:48 +02:00
sh sh: hd64461: Handle virq offset for offchip IRQ base and HD64461 IRQ 2023-07-19 16:22:18 +02:00
sparc sparc32: fix lock_mm_and_find_vma() conversion 2023-07-01 13:16:26 +02:00
um um: Use HOST_DIR for mrproper 2023-07-19 16:22:10 +02:00
x86 KVM: x86: Disallow KVM_SET_SREGS{2} if incoming CR0 is invalid 2023-08-03 10:24:08 +02:00
xtensa xtensa: ISS: fix call to split_if_spec 2023-07-23 13:49:45 +02:00
.gitignore
Kconfig ftrace: Allow WITH_ARGS flavour of graph tracer with shadow call stack 2022-12-31 13:32:45 +01:00