OSDN Git Service

arm/arm64: KVM: Take mmap_sem in kvm_arch_prepare_memory_region
authorMarc Zyngier <marc.zyngier@arm.com>
Thu, 16 Mar 2017 18:20:50 +0000 (18:20 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Apr 2017 10:38:33 +0000 (12:38 +0200)
commitd4ad442b9982fba9eab0f9003c8cd185a1afeff6
treec1581ac4984a6f3df11c70b1d54df03d9d59a5bc
parent8e88806117e4868bc459a3042e55f8bf06c0b9e0
arm/arm64: KVM: Take mmap_sem in kvm_arch_prepare_memory_region

commit 72f310481a08db821b614e7b5d00febcc9064b36 upstream.

We don't hold the mmap_sem while searching for VMAs (via find_vma), in
kvm_arch_prepare_memory_region, which can end up in expected failures.

Fixes: commit 8eef91239e57 ("arm/arm64: KVM: map MMIO regions at creation time")
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Eric Auger <eric.auger@rehat.com>
Reviewed-by: Christoffer Dall <cdall@linaro.org>
[ Handle dirty page logging failure case ]
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kvm/mmu.c