linux-stable/arch/arm64/kvm
Oliver Upton 6ddb4f372f KVM: arm64: vgic-v2: Check for non-NULL vCPU in vgic_v2_parse_attr()
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>
2024-04-24 19:09:35 +00:00
..
hyp KVM: arm64: Ensure target address is granule-aligned for range TLBI 2024-04-01 01:30:45 -07:00
vgic KVM: arm64: vgic-v2: Check for non-NULL vCPU in vgic_v2_parse_attr() 2024-04-24 19:09:35 +00:00
.gitignore
Kconfig Revert "KVM: arm64: Snapshot all non-zero RES0/RES1 sysreg fields for later checking" 2024-03-15 17:50:22 -07:00
Makefile
arch_timer.c KVM: arm64: Fix typos 2024-02-24 09:13:33 +00:00
arm.c KVM: arm64: Rationalise KVM banner output 2024-04-01 01:33:52 -07:00
debug.c KVM: arm64: debug: fix kernel-doc warnings 2024-02-01 20:25:41 +00:00
emulate-nested.c KVM: arm64: Propagate and handle Fine-Grained UNDEF bits 2024-02-19 17:13:01 +00:00
fpsimd.c S390: 2024-03-15 13:03:13 -07:00
guest.c S390: 2024-03-15 13:03:13 -07:00
handle_exit.c KVM: arm64: nv: Expand ERET trap forwarding to handle FGT 2023-08-17 10:00:27 +01:00
hypercalls.c Merge branch kvm-arm64/smccc-filter-cleanups into kvmarm/next 2023-10-30 20:18:37 +00:00
inject_fault.c KVM: arm64: Fix typos 2024-02-24 09:13:33 +00:00
mmio.c KVM: arm64: Add tracepoint for MMIO accesses where ISV==0 2023-10-30 20:17:22 +00:00
mmu.c KVM: arm64: Fix out-of-IPA space translation fault handling 2024-03-26 01:51:44 -07:00
nested.c KVM: arm64: nv: Add sanitising to VNCR-backed HCRX_EL2 2024-02-19 17:13:00 +00:00
pkvm.c KVM: arm64: Fix circular locking dependency 2024-01-30 21:30:33 +00:00
pmu-emul.c Merge branch kvm-arm64/kerneldoc into kvmarm/next 2024-03-07 00:56:16 +00:00
pmu.c KVM: arm64: pmu: Drop redundant check for non-NULL kvm_pmu_events 2023-10-12 16:13:39 +01:00
psci.c Merge branch kvm-arm64/smccc-filtering into kvmarm-master/next 2023-04-21 09:44:32 +01:00
pvtime.c
reset.c KVM: arm64: Allow guests with >48-bit IPA size on FEAT_LPA2 systems 2023-11-27 15:03:50 +00:00
stacktrace.c
sys_regs.c Revert "KVM: arm64: Snapshot all non-zero RES0/RES1 sysreg fields for later checking" 2024-03-15 17:50:22 -07:00
sys_regs.h KVM: arm64: Rename __check_nv_sr_forward() to triage_sysreg_trap() 2024-02-19 17:13:01 +00:00
trace.h
trace_arm.h KVM: arm64: Add tracepoint for MMIO accesses where ISV==0 2023-10-30 20:17:22 +00:00
trace_handle_exit.h
trng.c
va_layout.c
vgic-sys-reg-v3.c
vmid.c KVM: arm64: Reload stage-2 for VMID change on VHE 2023-10-20 17:52:01 +00:00