lkml.org 
[lkml]   [2022]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [patch V4 09/65] x86/fpu: Sanitize xstateregs_set()
On Wed, Jun 23, 2021 at 5:24 AM Thomas Gleixner <tglx@linutronix.de> wrote:
....
>
> - /*
> - * mxcsr reserved bits must be masked to zero for security reasons.
> - */
> - xsave->i387.mxcsr &= mxcsr_feature_mask;
> -
> - /*
> - * In case of failure, mark all states as init:
> - */
> - if (ret)
> - fpstate_init(&fpu->state);
> + fpu__prepare_write(fpu);
> + ret = copy_kernel_to_xstate(&fpu->state.xsave, kbuf ?: tmpbuf);

This change breaks gVisor. Now, when we set a new fpu state without
fp,sse and ymm
via ptrace, mxcsr isn't reset to the default value. The issue is
reproduced only on hosts
without xsaves. On hosts with xsaves, it works as expected.

Thanks,
Andrei

\
 
 \ /
  Last update: 2022-07-14 06:05    [W:0.370 / U:1.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site