From 8378ff00a95a483846fd597ba83a3abfc3ae6277 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Thu, 18 Feb 2021 18:15:46 -0500 Subject: [PATCH] Fixes for 4.19 Signed-off-by: Sasha Levin --- ...le-locking-due-to-incorrect-backport.patch | 36 +++++++++++++++++++ queue-4.19/series | 1 + 2 files changed, 37 insertions(+) create mode 100644 queue-4.19/kvm-sev-fix-double-locking-due-to-incorrect-backport.patch diff --git a/queue-4.19/kvm-sev-fix-double-locking-due-to-incorrect-backport.patch b/queue-4.19/kvm-sev-fix-double-locking-due-to-incorrect-backport.patch new file mode 100644 index 00000000000..42be237c3ed --- /dev/null +++ b/queue-4.19/kvm-sev-fix-double-locking-due-to-incorrect-backport.patch @@ -0,0 +1,36 @@ +From 09b21dcef97e85617a788e57090a064ab44c6200 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 18 Feb 2021 13:40:58 -0500 +Subject: KVM: SEV: fix double locking due to incorrect backport + +From: Paolo Bonzini + +Fix an incorrect line in the 5.4.y and 4.19.y backports of commit +19a23da53932bc ("Fix unsynchronized access to sev members through +svm_register_enc_region"), first applied to 5.4.98 and 4.19.176. + +Fixes: 1e80fdc09d12 ("KVM: SVM: Pin guest memory when SEV is active") +Reported-by: Dov Murik +Cc: stable@vger.kernel.org # 5.4.x +Cc: stable@vger.kernel.org # 4.19.x +Signed-off-by: Paolo Bonzini +Signed-off-by: Sasha Levin +--- + arch/x86/kvm/svm.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c +index b34d11f22213f..8cb9277aa6ff2 100644 +--- a/arch/x86/kvm/svm.c ++++ b/arch/x86/kvm/svm.c +@@ -7097,7 +7097,6 @@ static int svm_register_enc_region(struct kvm *kvm, + region->uaddr = range->addr; + region->size = range->size; + +- mutex_lock(&kvm->lock); + list_add_tail(®ion->list, &sev->regions_list); + mutex_unlock(&kvm->lock); + +-- +2.27.0 + diff --git a/queue-4.19/series b/queue-4.19/series index 0a769d3333e..137c1800cc8 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -35,3 +35,4 @@ net-rds-restrict-iovecs-length-for-rds_cmsg_rdma_args.patch net-qrtr-restrict-user-controlled-length-in-qrtr_tun_write_iter.patch ovl-expand-warning-in-ovl_d_real.patch x86-build-disable-cet-instrumentation-in-the-kernel-for-32-bit-too.patch +kvm-sev-fix-double-locking-due-to-incorrect-backport.patch -- 2.47.3