Re: [PATCH 15/23] x86/fpu: Add sanity checks for XFD

From: Thomas Gleixner
Date: Mon Oct 25 2021 - 16:25:22 EST


On Mon, Oct 25 2021 at 10:11, Borislav Petkov wrote:

> On Thu, Oct 21, 2021 at 03:55:19PM -0700, Chang S. Bae wrote:
>> @@ -217,12 +240,15 @@ static inline int xrstor_from_user_sigframe(struct xregs_state __user *buf, u64
>> * Restore xstate from kernel space xsave area, return an error code instead of
>> * an exception.
>> */
>> -static inline int os_xrstor_safe(struct xregs_state *xstate, u64 mask)
>> +static inline int os_xrstor_safe(struct fpstate *fpstate, u64 mask)
>> {
>> + struct xregs_state *xstate = &fpstate->regs.xsave;
>> u32 lmask = mask;
>> u32 hmask = mask >> 32;
>> int err;
>>
>> + /* Must enforce XFD update here */
>> +
>
> <--- something's missing here?

That comment is replaced in the next patch which adds the actual XFD
update. I added it as a reminder. Could probably go away.

Thanks,

tglx