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: <18758F52-BB97-4F47-9481-F66AF4465A06@vmware.com>
Date:   Thu, 2 Apr 2020 15:44:00 +0000
From:   Nadav Amit <namit@...are.com>
To:     Sean Christopherson <sean.j.christopherson@...el.com>
CC:     Thomas Gleixner <tglx@...utronix.de>,
        LKML <linux-kernel@...r.kernel.org>, x86 <x86@...nel.org>,
        "Kenneth R. Crudup" <kenny@...ix.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Fenghua Yu <fenghua.yu@...el.com>,
        Xiaoyao Li <xiaoyao.li@...el.com>,
        Thomas Hellstrom <thellstrom@...are.com>,
        Tony Luck <tony.luck@...el.com>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Jessica Yu <jeyu@...nel.org>,
        Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [patch 2/2] x86/kvm/vmx: Prevent split lock detection induced #AC
 wreckage

> On Apr 2, 2020, at 8:30 AM, Sean Christopherson <sean.j.christopherson@...el.com> wrote:
> 
> On Thu, Apr 02, 2020 at 02:33:00PM +0200, Thomas Gleixner wrote:
>> Without at least minimal handling for split lock detection induced #AC, VMX
>> will just run into the same problem as the VMWare hypervisor, which was
>> reported by Kenneth.
>> 
>> It will inject the #AC blindly into the guest whether the guest is prepared
>> or not.
>> 
>> Add the minimal required handling for it:
>> 
>>  - Check guest state whether CR0.AM is enabled and EFLAGS.AC is set.  If
>>    so, then the #AC originated from CPL3 and the guest has is prepared to
>>    handle it. In this case it does not matter whether the #AC is due to a
>>    split lock or a regular unaligned check.
>> 
>> - Invoke a minimal split lock detection handler. If the host SLD mode is
>>   sld_warn, then handle it in the same way as user space handling works:
>>   Emit a warning, disable SLD and mark the current task with TIF_SLD.
>>   With that resume the guest without injecting #AC.
>> 
>>   If the host mode is sld_fatal or sld_off, emit a warning and deliver
>>   the exception to user space which can crash and burn itself.
>> 
>> Mark the module with MOD_INFO(sld_safe, "Y") so the module loader does not
>> force SLD off.
> 
> Some comments below.  But, any objection to taking Xiaoyao's patches that
> do effectively the same things, minus the MOD_INFO()?  I'll repost them in
> reply to this thread.

IIUC they also deal with emulated split-lock accesses in the host, during
instruction emulation [1]. This seems also to be required, although I am not
sure the approach that he took once emulation encounters a split-lock is
robust.

[1] https://lore.kernel.org/lkml/20200324151859.31068-5-xiaoyao.li@intel.com/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ