• Sean Christopherson's avatar
    KVM: x86/mmu: Check for shadow-present SPTE before querying A/D status · 64bb2769
    Sean Christopherson authored
    When updating accessed and dirty bits, check that the new SPTE is present
    before attempting to query its A/D bits.  Failure to confirm the SPTE is
    present can theoretically cause a false negative, e.g. if a MMIO SPTE
    replaces a "real" SPTE and somehow the PFNs magically match.
    
    Realistically, this is all but guaranteed to be a benign bug.  Fix it up
    primarily so that a future patch can tweak the MMU_WARN_ON checking A/D
    status to fire if the SPTE is not-present.
    
    Fixes: f8e14497 ("kvm: x86/mmu: Add access tracking for tdp_mmu")
    Cc: Ben Gardon <bgardon@google.com>
    Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
    Message-Id: <20210225204749.1512652-3-seanjc@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    64bb2769
tdp_mmu.c 39.2 KB