linux-stable/arch
Oliver Upton 3a5b0378ac KVM: arm64: vgic-v2: Check for non-NULL vCPU in vgic_v2_parse_attr()
[ Upstream commit 6ddb4f372f ]

vgic_v2_parse_attr() is responsible for finding the vCPU that matches
the user-provided CPUID, which (of course) may not be valid. If the ID
is invalid, kvm_get_vcpu_by_id() returns NULL, which isn't handled
gracefully.

Similar to the GICv3 uaccess flow, check that kvm_get_vcpu_by_id()
actually returns something and fail the ioctl if not.

Cc: stable@vger.kernel.org
Fixes: 7d450e2821 ("KVM: arm/arm64: vgic-new: Add userland access to VGIC dist registers")
Reported-by: Alexander Potapenko <glider@google.com>
Tested-by: Alexander Potapenko <glider@google.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240424173959.3776798-2-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-05-17 11:56:03 +02:00
..
alpha rtc: Add support for configuring the UIP timeout for RTC reads 2024-01-31 16:17:01 -08:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:29:23 +02:00
arm ARM: dts: microchip: at91-sama7g5ek: Replace regulator-suspend-voltage with the valid property 2024-05-02 16:29:23 +02:00
arm64 KVM: arm64: vgic-v2: Check for non-NULL vCPU in vgic_v2_parse_attr() 2024-05-17 11:56:03 +02:00
csky work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:12:28 +01:00
hexagon hexagon: vmlinux.lds.S: handle attributes section 2024-04-03 15:19:48 +02:00
ia64 ia64/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:46 +02:00
loongarch LoongArch: Fix access error when read fault on a write-only VMA 2024-05-02 16:29:28 +02:00
m68k m68k: Fix invalid .section syntax 2023-09-13 09:42:21 +02:00
microblaze
mips MIPS: Clear Cause.BD in instruction_pointer_set 2024-03-26 18:20:24 -04:00
nios2
openrisc
parisc parisc: Strip upper 32 bit of sum in csum_ipv6_magic for 64-bit builds 2024-04-03 15:19:28 +02:00
powerpc powerpc/pseries/iommu: LPAR panics during boot up with a frozen PE 2024-05-17 11:56:03 +02:00
riscv riscv: Fix TASK_SIZE on 64-bit NOMMU 2024-05-02 16:29:31 +02:00
s390 s390/vdso: Add CFI for RA register to asm macro vdso_func 2024-05-17 11:55:59 +02:00
sh sh: bios: Revive earlyprintk support 2023-11-20 11:52:07 +01:00
sparc sparc32: Fix parport build with sparc32 2024-04-03 15:19:33 +02:00
um um: Fix adding '-no-pie' for clang 2024-02-23 09:12:38 +01:00
x86 x86/tdx: Preserve shared bit on mprotect() 2024-05-02 16:29:30 +02:00
xtensa work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:12:28 +01:00
.gitignore
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-05-02 16:29:28 +02:00