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]
Date:   Tue, 01 Sep 2020 12:36:40 +0200
From:   Vitaly Kuznetsov <vkuznets@...hat.com>
To:     Sean Christopherson <sean.j.christopherson@...el.com>,
        Jim Mattson <jmattson@...gle.com>
Cc:     Paolo Bonzini <pbonzini@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        kvm list <kvm@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] KVM: VMX: fix crash cleanup when KVM wasn't used

Sean Christopherson <sean.j.christopherson@...el.com> writes:

> On Mon, Aug 24, 2020 at 03:45:26PM -0700, Jim Mattson wrote:
>> On Mon, Aug 24, 2020 at 11:57 AM Jim Mattson <jmattson@...gle.com> wrote:
>> >
>> > On Fri, Aug 21, 2020 at 8:40 PM Sean Christopherson
>> > <sean.j.christopherson@...el.com> wrote:
>> > > I agree the code is a mess (kvm_init() and kvm_exit() included), but I'm
>> > > pretty sure hardware_disable_nolock() is guaranteed to be a nop as it's
>> > > impossible for kvm_usage_count to be non-zero if vmx_init() hasn't
>> > > finished.
>> >
>> > Unless I'm missing something, there's no check for a non-zero
>> > kvm_usage_count on this path. There is such a check in
>> > hardware_disable_all_nolock(), but not in hardware_disable_nolock().
>> 
>> However, cpus_hardware_enabled shouldn't have any bits set, so
>> everything's fine. Nothing to see here, after all.
>
> Ugh, I forgot that hardware_disable_all_nolock() does a BUG_ON() instead of
> bailing on !kvm_usage_count.

But we can't hit this BUG_ON(), right? I'm failing to see how
hardware_disable_all_nolock() can be reached with kvm_usage_count==0.

-- 
Vitaly

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ