* Patch "KVM: PPC: Book3S HV: Hold kvm->lock around call to kvmppc_update_lpcr" has been added to the 4.13-stable tree
@ 2017-10-02 9:41 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-10-02 9:41 UTC (permalink / raw)
To: paulus, gregkh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
KVM: PPC: Book3S HV: Hold kvm->lock around call to kvmppc_update_lpcr
to the 4.13-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
kvm-ppc-book3s-hv-hold-kvm-lock-around-call-to-kvmppc_update_lpcr.patch
and it can be found in the queue-4.13 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From cf5f6f3125241853462334b1bc696f3c3c492178 Mon Sep 17 00:00:00 2001
From: Paul Mackerras <paulus@ozlabs.org>
Date: Mon, 11 Sep 2017 16:05:30 +1000
Subject: KVM: PPC: Book3S HV: Hold kvm->lock around call to kvmppc_update_lpcr
From: Paul Mackerras <paulus@ozlabs.org>
commit cf5f6f3125241853462334b1bc696f3c3c492178 upstream.
Commit 468808bd35c4 ("KVM: PPC: Book3S HV: Set process table for HPT
guests on POWER9", 2017-01-30) added a call to kvmppc_update_lpcr()
which doesn't hold the kvm->lock mutex around the call, as required.
This adds the lock/unlock pair, and for good measure, includes
the kvmppc_setup_partition_table() call in the locked region, since
it is altering global state of the VM.
This error appears not to have any fatal consequences for the host;
the consequences would be that the VCPUs could end up running with
different LPCR values, or an update to the LPCR value by userspace
using the one_reg interface could get overwritten, or the update
done by kvmhv_configure_mmu() could get overwritten.
Fixes: 468808bd35c4 ("KVM: PPC: Book3S HV: Set process table for HPT guests on POWER9")
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/powerpc/kvm/book3s_hv.c | 2 ++
1 file changed, 2 insertions(+)
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -4187,11 +4187,13 @@ static int kvmhv_configure_mmu(struct kv
if ((cfg->process_table & PRTS_MASK) > 24)
return -EINVAL;
+ mutex_lock(&kvm->lock);
kvm->arch.process_table = cfg->process_table;
kvmppc_setup_partition_table(kvm);
lpcr = (cfg->flags & KVM_PPC_MMUV3_GTSE) ? LPCR_GTSE : 0;
kvmppc_update_lpcr(kvm, lpcr, LPCR_GTSE);
+ mutex_unlock(&kvm->lock);
return 0;
}
Patches currently in stable-queue which might be from paulus@ozlabs.org are
queue-4.13/kvm-ppc-book3s-hv-hold-kvm-lock-around-call-to-kvmppc_update_lpcr.patch
queue-4.13/kvm-ppc-book3s-hv-don-t-access-xive-pipr-register-using-byte-accesses.patch
queue-4.13/kvm-ppc-book3s-hv-fix-bug-causing-host-slb-to-be-restored-incorrectly.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-10-02 9:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-02 9:41 Patch "KVM: PPC: Book3S HV: Hold kvm->lock around call to kvmppc_update_lpcr" has been added to the 4.13-stable tree gregkh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.