android_kernel_samsung_sm8650/arch
Paolo Bonzini ec18273e41 KVM: SEV: snapshot the GHCB before accessing it
commit 4e15a0ddc3ff40e8ea84032213976ecf774d7f77 upstream.

Validation of the GHCB is susceptible to time-of-check/time-of-use vulnerabilities.
To avoid them, we would like to always snapshot the fields that are read in
sev_es_validate_vmgexit(), and not use the GHCB anymore after it returns.

This means:

- invoking sev_es_sync_from_ghcb() before any GHCB access, including before
  sev_es_validate_vmgexit()

- snapshotting all fields including the valid bitmap and the sw_scratch field,
  which are currently not caching anywhere.

The valid bitmap is the first thing to be copied out of the GHCB; then,
further accesses will use the copy in svm->sev_es.

Fixes: 291bd20d5d ("KVM: SVM: Add initial support for a VMGEXIT VMEXIT")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-16 18:27:20 +02:00
..
alpha init: Remove check_bugs() leftovers 2023-08-08 20:03:47 +02:00
arc ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard 2023-07-19 16:21:42 +02:00
arm ARM: cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:46 +02:00
arm64 arm64/ptrace: Don't enable SVE when setting streaming SVE 2023-08-11 12:08:26 +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 ia64/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:46 +02:00
loongarch Revert "loongarch/cpu: Switch to arch_cpu_finalize_init()" 2023-08-16 18:27:20 +02:00
m68k m68k/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:46 +02:00
microblaze mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
mips mips/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:47 +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 init: Remove check_bugs() leftovers 2023-08-08 20:03:47 +02:00
powerpc powerpc/mm/altmap: Fix altmap boundary check 2023-08-11 12:08:25 +02:00
riscv riscv: mm: fix truncation warning on RV32 2023-07-23 13:49:26 +02:00
s390 KVM: s390: fix sthyi error handling 2023-08-11 12:08:11 +02:00
sh sh/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:47 +02:00
sparc sparc/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:47 +02:00
um um/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:47 +02:00
x86 KVM: SEV: snapshot the GHCB before accessing it 2023-08-16 18:27:20 +02:00
xtensa init: Remove check_bugs() leftovers 2023-08-08 20:03:47 +02:00
.gitignore
Kconfig init: Provide arch_cpu_finalize_init() 2023-08-08 20:03:46 +02:00