Re: [PATCH v2 8/8] x86/fpu/xstate: Restore supervisor xstates for __fpu__restore_sig()

From: Borislav Petkov
Date: Fri Mar 06 2020 - 15:50:50 EST


On Wed, Mar 04, 2020 at 10:18:46AM -0800, Yu-cheng Yu wrote:
> There is another way to keep this patch...
>
> if (xfeatures_mask_supervisor()) {
> fpu->state.xsave.xfeatures &= xfeatures_mask_supervisor();

Is the subsequent XSAVE in copy_user_to_fpregs_zeroing() going to
restore the user bits in XSTATE_BV you just cleared?

Sorry, it looks like it would but the SDM text is abysmal.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette