linux-sg2042/arch
Alexey Gladkov (Intel) 4c0c5dcb54 x86/tdx: Fix "in-kernel MMIO" check
commit d4fc4d0147 upstream.

TDX only supports kernel-initiated MMIO operations. The handle_mmio()
function checks if the #VE exception occurred in the kernel and rejects
the operation if it did not.

However, userspace can deceive the kernel into performing MMIO on its
behalf. For example, if userspace can point a syscall to an MMIO address,
syscall does get_user() or put_user() on it, triggering MMIO #VE. The
kernel will treat the #VE as in-kernel MMIO.

Ensure that the target MMIO address is within the kernel before decoding
instruction.

Fixes: 31d58c4e55 ("x86/tdx: Handle in-kernel MMIO")
Signed-off-by: Alexey Gladkov (Intel) <legion@kernel.org>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc:stable@vger.kernel.org
Link: https://lore.kernel.org/all/565a804b80387970460a4ebc67c88d1380f61ad1.1726237595.git.legion%40kernel.org
Signed-off-by: Alexey Gladkov (Intel) <legion@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-04 16:30:05 +02:00
..
alpha Revert "change alloc_pages name in dma_map_ops to avoid name conflicts" 2024-09-04 13:28:24 +02:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:32:33 +02:00
arm ARM: dts: imx6ul-geam: fix fsl,pins property in tscgrp pinctrl 2024-10-04 16:29:57 +02:00
arm64 arm64: dts: rockchip: Correct the Pinebook Pro battery design capacity 2024-10-04 16:29:55 +02:00
csky csky, hexagon: fix broken sys_sync_file_range 2024-07-05 09:34:02 +02:00
hexagon hexagon: fix fadvise64_64 calling conventions 2024-07-05 09:34:02 +02:00
ia64 vgacon: rework screen_info #ifdef checks 2024-06-27 13:49:15 +02:00
loongarch LoongArch: Define ARCH_IRQ_INIT_FLAGS as IRQ_NOPROBE 2024-09-30 16:25:09 +02:00
m68k m68k: Fix kernel_clone_args.flags in m68k_clone() 2024-10-04 16:29:05 +02:00
microblaze microblaze: don't treat zero reserved memory regions as error 2024-09-30 16:25:08 +02:00
mips MIPS: cevt-r4k: Don't call get_c0_compare_int if timer irq is installed 2024-09-12 11:11:39 +02:00
nios2 mm: Introduce flush_cache_vmap_early() 2024-02-16 19:10:52 +01:00
openrisc openrisc: Call setup_memory() earlier in the init sequence 2024-08-29 17:33:39 +02:00
parisc parisc: Use irq_enter_rcu() to fix warning at kernel/context_tracking.c:367 2024-08-29 17:33:36 +02:00
powerpc powerpc/atomic: Use YZ constraints for DS-form instructions 2024-10-04 16:29:48 +02:00
riscv riscv: Fix fp alignment bug in perf_callchain_user() 2024-10-04 16:29:34 +02:00
s390 s390/vmlinux.lds.S: Move ro_after_init section behind rodata section 2024-09-12 11:11:38 +02:00
sh sh: rework sync_file_range ABI 2024-07-05 09:34:02 +02:00
sparc sparc64: Fix incorrect function signature and add prototype for prom_cif_init 2024-08-03 08:53:55 +02:00
um um: line: always fill *error_out in setup_one_line() 2024-09-12 11:11:35 +02:00
x86 x86/tdx: Fix "in-kernel MMIO" check 2024-10-04 16:30:05 +02:00
xtensa xtensa: fix MAKE_PC_FROM_RA second argument 2024-05-17 12:02:32 +02:00
.gitignore
Kconfig Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default" 2024-06-27 13:49:15 +02:00