diff options
| author | Hyunwoo Kim <imv4bel@gmail.com> | 2026-06-05 11:27:01 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-06-09 13:32:50 +0300 |
| commit | 4424dbcb06d68e34e51c019a5781a7dc00731971 (patch) | |
| tree | 27531df55918fce8b14fd86fa89ddf7906622c80 /tools/lib/python/kdoc/python_version.py | |
| parent | 9121f4605ab94969f62d1b5714ca3c6c69bd202f (diff) | |
| download | linux-4424dbcb06d68e34e51c019a5781a7dc00731971.tar.xz | |
KVM: arm64: Reassign nested_mmus array behind mmu_lock
commit 70543358fa08e0f7cebc3447c3b70fe97ad7aaa8 upstream.
kvm->arch.nested_mmus[] is walked under kvm->mmu_lock, including from the
MMU notifier path (kvm_unmap_gfn_range() -> kvm_nested_s2_unmap()), which
can run at any time. kvm_vcpu_init_nested() reallocates the array and frees
the old buffer while holding only kvm->arch.config_lock, so such a walker
can reference the freed array.
Allocate the new array outside of mmu_lock, as the allocation can sleep.
Under the lock, copy the existing entries, fix up the back pointers and
reassign the array. Free the old buffer after dropping the lock, as
kvfree() can sleep as well.
Fixes: 4f128f8e1aaac ("KVM: arm64: nv: Support multiple nested Stage-2 mmu structures")
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Reviewed-by: Oliver Upton <oupton@kernel.org>
Link: https://patch.msgid.link/aiKIVVeIr1aAB1yp@v4bel
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger,kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
