FAILED: patch "[PATCH] KVM: arm64: Take the SRCU lock for page table walks in fault" failed to apply to 6.12-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x f2ca45b50d4216c9cc7ffabf50d9ad1932209251
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026061527-county-underwent-3b10@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From f2ca45b50d4216c9cc7ffabf50d9ad1932209251 Mon Sep 17 00:00:00 2001
From: Hyunwoo Kim <[email protected]>
Date: Wed, 3 Jun 2026 21:09:33 +0900
Subject: [PATCH] KVM: arm64: Take the SRCU lock for page table walks in fault
injection and AT emulation
walk_s1() and kvm_walk_nested_s2() expect to be called while holding kvm->srcu to guard against memslot changes. While this is generally the case, __kvm_at_s12() and __kvm_find_s1_desc_level() call into the respective walkers without taking kvm->srcu.
Fix by acquiring kvm->srcu prior to the table walk in both instances.
arch/arm64/kvm/at.c +4 -2
@@ -1569,7 +1569,8 @@ int __kvm_at_s12(struct kvm_vcpu *vcpu, u32 op, u64 vaddr)/* Do the stage-2 translation */ ipa = (par &GENMASK_ULL (47 ,12 )) | (vaddr &GENMASK_ULL (11 ,0 )); out.esr =0 ; - ret =kvm_walk_nested_s2 (vcpu, ipa, &out); +scoped_guard (srcu, &vcpu->kvm->srcu) + ret = kvm_walk_nested_s2(vcpu, ipa, &out);if (ret <0 )return ret;
@@ -1665,7 +1666,8 @@ int __kvm_find_s1_desc_level(struct kvm_vcpu *vcpu, u64 va, u64 ipa, int *level) }/* Walk the guest's PT, looking for a match along the way */ - ret =walk_s1 (vcpu, &wi, &wr, va); +scoped_guard (srcu, &vcpu->kvm->srcu) + ret = walk_s1(vcpu, &wi, &wr, va);switch (ret) {case -EINTR :/* We interrupted the walk on a match, return the level */