[Disco,04/10] kvm: fix compile on s390 part 2
diff mbox series

Message ID 20200131111035.38050-5-cascardo@canonical.com
State New
Headers show
Series
  • CVE-2019-3016
Related show

Commit Message

Thadeu Lima de Souza Cascardo Jan. 31, 2020, 11:10 a.m. UTC
From: Christian Borntraeger <borntraeger@de.ibm.com>

CVE-2019-3016
CVE-2020-3016

We also need to fence the memunmap part.

Fixes: e45adf665a53 ("KVM: Introduce a new guest mapping API")
Fixes: d30b214d1d0a (kvm: fix compilation on s390)
Cc: Michal Kubecek <mkubecek@suse.cz>
Cc: KarimAllah Ahmed <karahmed@amazon.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
(cherry picked from commit eb1f2f387db8c0d084581fb26e7faffde700bc8e)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 virt/kvm/kvm_main.c | 2 ++
 1 file changed, 2 insertions(+)

Patch
diff mbox series

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index f4d59133dce6..8d7585b99499 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1843,8 +1843,10 @@  void kvm_vcpu_unmap(struct kvm_vcpu *vcpu, struct kvm_host_map *map,
 
 	if (map->page)
 		kunmap(map->page);
+#ifdef CONFIG_HAS_IOMEM
 	else
 		memunmap(map->hva);
+#endif
 
 	if (dirty) {
 		kvm_vcpu_mark_page_dirty(vcpu, map->gfn);