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, 13 Oct 2022 10:44:22 -0700
From:   Dave Hansen <dave.hansen@...el.com>
To:     "Chang S. Bae" <chang.seok.bae@...el.com>,
        "Yao, Yuan" <yuan.yao@...el.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Cc:     "x86@...nel.org" <x86@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] x86/fpu: Remove dynamic features from xcomp_bv for
 init_fpstate

On 10/13/22 10:33, Chang S. Bae wrote:
>>>
>>> -       mask = fpstate->user_xfeatures;
>>> +       mask = fpstate->user_xfeatures & fpstate->xfeatures;
>>
>> I'm not sure this is quite right either.
>>
>> Doesn't kvm expect that all of the ->user_xfeatures will end up being
>> copied out?  We surely can't copy them from 'fpstate' if the feature
>> isn't there, but we can't skip them entirely, can we?
> 
> No, we can't skip them. IIUC, the code will zero out:
> 
>     /*
>      * ... The gap tracking will zero these states.
>      */
>     mask = fpstate->user_xfeatures;
> 
>     for_each_extended_xfeature(i, mask) {
>         /*
>          * If there was a feature or alignment gap, zero the space
>          * in the destination buffer.
>          */
>         if (zerofrom < xstate_offsets[i])
>             membuf_zero(&to, xstate_offsets[i] - zerofrom);
> 
>         <snip>

Ahh, good point.  A better comment for that would be:

	 * Some user_xfeatures may not be present in the fpstate.
	 * Remove those from 'mask' to zero those features in the
	 * user buffer instead of retrieving them from fpstate.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ