kernel_samsung_a53x/arch/arm64/kvm
Oliver Upton f2a1bdd4e3 KVM: arm64: vgic-v2: Check for non-NULL vCPU in vgic_v2_parse_attr()
[ Upstream commit 6ddb4f372fc63210034b903d96ebbeb3c7195adb ]

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: 7d450e282171 ("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-11-19 11:32:43 +01:00
..
hyp arm64: lse: Always use LSE atomic instructions 2024-11-17 17:45:05 +01:00
vgic KVM: arm64: vgic-v2: Check for non-NULL vCPU in vgic_v2_parse_attr() 2024-11-19 11:32:43 +01:00
arch_timer.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
arm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
debug.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fpsimd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
guest.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
handle_exit.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hypercalls.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
inject_fault.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
irq.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmu.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
perf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pmu-emul.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pmu.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
psci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pvtime.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reset.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sys_regs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sys_regs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace_arm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace_handle_exit.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trng.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
va_layout.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vgic-sys-reg-v3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00