lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c3252adb-03bc-c6b7-e851-168e5546d144@redhat.com>
Date:   Fri, 11 Aug 2017 08:40:55 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Paolo Bonzini <pbonzini@...hat.com>,
        Wanpeng Li <kernellwp@...il.com>, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org
Cc:     Radim Krčmář <rkrcmar@...hat.com>,
        Wanpeng Li <wanpeng.li@...mail.com>,
        Brijesh Singh <brijesh.singh@....com>
Subject: Re: [PATCH] KVM: MMU: Fix guest stuck during boot due to read/write
 emulation against GVA

On 11.08.2017 08:13, Paolo Bonzini wrote:
> On 11/08/2017 07:59, Wanpeng Li wrote:
>> From: Wanpeng Li <wanpeng.li@...mail.com>
>>
>> Commit c016004494b0 (KVM: x86: Avoid guest page table walk when gpa_available 
>> is set) avoids the page table walk when cr2 has already contained a valid GPA. 
>> However, that is not the truth if ept == 0 and shadow page table is used. In 
>> this scenario cr2 can just contains a valid GVA. The commit results in guest 
>> stuck during boot due to read/write emulation against GVA instead of GPA of 
>> the guest.
>>
>> This patch fixes it by not setting the gpa_available flag if the shadow page table 
>> is used.
> 
> Yup, I got these on my overnight tests too.  A better fix that I was
> going to commit today is:
> 
>                 if (vcpu->arch.mmu.direct_map) {
>                         vcpu->arch.gpa_available = true;
>                         vcpu->arch.gpa_val = fault_address;
>                 }
> 

Makes sense to me. Can we add a comment?

/* with shadow page tables, cr2 could contain a GVA, not a GPA */

> because AMD gets here even if npt=1.
> 
> Paolo

-- 

Thanks,

David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ