lkml.org 
[lkml]   [2021]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch V2 08/52] x86/fpu: Sanitize xstateregs_set()
Date
On Tue, Jun 15 2021 at 19:40, Borislav Petkov wrote:
> On Mon, Jun 14, 2021 at 05:44:16PM +0200, Thomas Gleixner wrote:
>> @@ -108,10 +110,10 @@ int xstateregs_set(struct task_struct *t
>> const void *kbuf, const void __user *ubuf)
>> {
>> struct fpu *fpu = &target->thread.fpu;
>> - struct xregs_state *xsave;
>> + struct xregs_state *tmpbuf = NULL;
>> int ret;
>>
>> - if (!boot_cpu_has(X86_FEATURE_XSAVE))
>> + if (!static_cpu_has(X86_FEATURE_XSAVE))
>
> cpu_feature_enabled() - we're going to use only that thing from now on
> for simplicity.

Sure, I just run sed over the set.

>> + fpu__prepare_write(fpu);
>
> Yikes, why isn't this function called
>
> fpu_invalidate_state(fpu)

Because...

>> + /* mxcsr reserved bits must be masked to zero for historical reasons. */
>
> Wasn't that comment supposed to get some love?

See the next patch ...

\
 
 \ /
  Last update: 2021-06-15 23:32    [W:0.418 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site