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:   Thu, 17 Oct 2019 00:25:27 +0800
From:   Xiaoyao Li <xiaoyao.li@...el.com>
To:     Paolo Bonzini <pbonzini@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>
Cc:     Sean Christopherson <sean.j.christopherson@...el.com>,
        Fenghua Yu <fenghua.yu@...el.com>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        H Peter Anvin <hpa@...or.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Dave Hansen <dave.hansen@...el.com>,
        Radim Krcmar <rkrcmar@...hat.com>,
        Ashok Raj <ashok.raj@...el.com>,
        Tony Luck <tony.luck@...el.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Sai Praneeth Prakhya <sai.praneeth.prakhya@...el.com>,
        Ravi V Shankar <ravi.v.shankar@...el.com>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        x86 <x86@...nel.org>, kvm@...r.kernel.org
Subject: Re: [PATCH v9 09/17] x86/split_lock: Handle #AC exception for split
 lock

On 10/16/2019 11:37 PM, Paolo Bonzini wrote:
> On 16/10/19 16:43, Thomas Gleixner wrote:
>>
>> N | #AC       | #AC enabled | SMT | Ctrl    | Guest | Action
>> R | available | on host     |     | exposed | #AC   |
>> --|-----------|-------------|-----|---------|-------|---------------------
>>    |           |             |     |         |       |
>> 0 | N         |     x       |  x  |   N     |   x   | None
>>    |           |             |     |         |       |
>> 1 | Y         |     N       |  x  |   N     |   x   | None
> 
> So far so good.
> 
>> 2 | Y         |     Y       |  x  |   Y     |   Y   | Forward to guest
>>
>> 3 | Y         |     Y       |  N  |   Y     |   N   | A) Store in vCPU and
>>    |           |             |     |         |       |    toggle on VMENTER/EXIT
>>    |           |             |     |         |       |
>>    |           |             |     |         |       | B) SIGBUS or KVM exit code
> 
> (2) is problematic for the SMT=y case, because of what happens when #AC
> is disabled on the host---safe guests can start to be susceptible to
> DoS.
> 
> For (3), which is the SMT=n case,, the behavior is the same independent of
> guest #AC.
> 
> So I would change these two lines to:
> 
>    2 | Y         |     Y       |  Y  |   N     |   x   | On first guest #AC,
>      |           |             |     |         |       | disable globally on host.
>      |           |             |     |         |       |
>    3 | Y         |     Y       |  N  |   Y     |   x   | Switch MSR_TEST_CTRL on
>      |           |             |     |         |       | enter/exit, plus:
>      |           |             |     |         |       | A) #AC forwarded to guest.
>      |           |             |     |         |       | B) SIGBUS or KVM exit code
>

I just want to get confirmed that in (3), we should split into 2 case:

a) if host has it enabled, still apply the constraint that guest is 
forcibly enabled? so we don't switch MSR_TEST_CTL.

b) if host has it disabled, we can switch MSR_TEST_CTL on enter/exit.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ