Patch "KVM: arm64: Force PTE mapping on fault resulting in a device mapping" has been added to the 5.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    KVM: arm64: Force PTE mapping on fault resulting in a device mapping

to the 5.9-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-arm64-force-pte-mapping-on-fault-resulting-in-a-.patch
and it can be found in the queue-5.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 9839f6b9a91436708dc4912c681327bc1a7d5427
Author: Santosh Shukla <sashukla@xxxxxxxxxx>
Date:   Mon Oct 26 16:54:07 2020 +0530

    KVM: arm64: Force PTE mapping on fault resulting in a device mapping
    
    [ Upstream commit 91a2c34b7d6fadc9c5d9433c620ea4c32ee7cae8 ]
    
    VFIO allows a device driver to resolve a fault by mapping a MMIO
    range. This can be subsequently result in user_mem_abort() to
    try and compute a huge mapping based on the MMIO pfn, which is
    a sure recipe for things to go wrong.
    
    Instead, force a PTE mapping when the pfn faulted in has a device
    mapping.
    
    Fixes: 6d674e28f642 ("KVM: arm/arm64: Properly handle faulting of device mappings")
    Suggested-by: Marc Zyngier <maz@xxxxxxxxxx>
    Signed-off-by: Santosh Shukla <sashukla@xxxxxxxxxx>
    [maz: rewritten commit message]
    Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
    Reviewed-by: Gavin Shan <gshan@xxxxxxxxxx>
    Cc: stable@xxxxxxxxxxxxxxx
    Link: https://lore.kernel.org/r/1603711447-11998-2-git-send-email-sashukla@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
index 3d26b47a13430..7a4ad984d54e0 100644
--- a/arch/arm64/kvm/mmu.c
+++ b/arch/arm64/kvm/mmu.c
@@ -1920,6 +1920,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 	if (kvm_is_device_pfn(pfn)) {
 		mem_type = PAGE_S2_DEVICE;
 		flags |= KVM_S2PTE_FLAG_IS_IOMAP;
+		force_pte = true;
 	} else if (logging_active) {
 		/*
 		 * Faults on pages in a memslot with logging enabled



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux