diff options
| author | Marc Zyngier <maz@kernel.org> | 2026-06-07 18:57:45 +0100 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2026-06-10 11:51:03 +0100 |
| commit | 4be6cbeb93d26994bd1827ddbce391e3c4395c8f (patch) | |
| tree | 46c81401b18c974661f669b39ff4ee59e6b5caff /scripts/include | |
| parent | 6bef47288ce1cb8302c84753164b8f8f6d63e0b3 (diff) | |
KVM: arm64: nv: Avoid dereferencing NULL VNCR pseudo-TLB
VNCR TLB invalidation occurs from MMU notifiers or TLBI instructions,
and either can race against a vcpu not being onlined yet (no pseudo-TLB
allocated). Similarly, the TLB might be invalid, and the invalidation
should be skipped in this case.
Both kvm_invalidate_vncr_ipa() and kvm_invalidate_vncr_va() are
expected to perform the same checks, except that the latter doesn't
check for the allocation and blindly dereferences the pointer.
Solve this by introducing a new iterator built on top of the usual
kvm_for_each_vcpu() that checks for both of the above conditions,
and convert the two users to it.
Reported-by: Hyunwoo Kim <imv4bel@gmail.com>
Link: https://lore.kernel.org/r/aiUvSbrWndQeUPc8@v4bel
Fixes: 4ffa72ad8f37 ("KVM: arm64: nv: Add S1 TLB invalidation primitive for VNCR_EL2")
Cc: stable@vger.kernel.org
Reviewed-by: Oliver Upton <oupton@kernel.org>
Link: https://patch.msgid.link/20260607175745.297793-1-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'scripts/include')
0 files changed, 0 insertions, 0 deletions
