diff options
| author | Marc Zyngier <maz@kernel.org> | 2026-06-08 09:11:08 +0100 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2026-06-10 13:01:12 +0100 |
| commit | 4b54e2374d1bd82031cef9784e125a7100a32499 (patch) | |
| tree | a8dd284cab312d743a21eac231053732c419ff5a /tools/lib/python | |
| parent | 4be6cbeb93d26994bd1827ddbce391e3c4395c8f (diff) | |
KVM: arm64: nv: Hold kvm->mmu_lock while initialising vcpu->arch.vncr_tlb
Sashiko reports that there is a race between initialising vncr_tlb
and making use of it, as we don't hold the mmu_lock at this point.
Additionally, it identifies a memory leak, should userspace repeatedly
invokes the KVM_RUN ioctl after a failure of kvm_arch_vcpu_run_pid_change(),
as we assign vncr_tlb blindly on first run, irrespective of prior
allocations.
Slap the two bugs in one go by taking the kvm->mmu_lock on assigning
vncr_tlb, preventing the race for good, and by checking that vncr_tlb
is indeed NULL prior to allocation.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/r/20260607180815.85FBC1F00893@smtp.kernel.org
Reviewed-by: Oliver Upton <oupton@kernel.org>
Link: https://patch.msgid.link/20260608081108.2244133-1-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
