Re: [tip: x86/fpu] x86/fpu/xstate: Define new functions for clearing fpregs and xstates

From: Thomas Gleixner
Date: Tue May 25 2021 - 14:00:21 EST


On Tue, May 25 2021 at 10:44, Yu-cheng Yu wrote:
> On 5/24/2021 9:34 AM, Andy Lutomirski wrote:
>> So I'm guessing that syzbot may have misattributed the problem. But
>> we definitely need to clean up the XRSTOR #GP handling before CET
>> lands.
>>
> From the crash dump, the system is doing syscall_exit_to_user_mode()
> for __x64_sys_futex(). The futex syscall does not seem to modify
> xstates,

Of course does the futex syscall not modify anything, but the task can
schedule out before returning from the syscall so it has to restore the
FPU state.

> but upon returning to user mode, XRSTORS gets a GP. Can this
> be some memory corruption? fpu__clear() is merely helping to clear the
> mess and seems to be innocent.

What kind of analysis is that?

Thanks,

tglx