lkml.org 
[lkml]   [2019]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 8/9] x86/fpu: correctly check for kthreads
On 2019-08-14 14:39:10 [+0100], Mark Rutland wrote:
> I think this was missed in commit.
> > 8d3289f2fa1e0 ("x86/fpu: Don't use current->mm to check for a kthread")
>
> Yup, though if it's a bug it's been a bug since commit:
>
> 0cecca9d03c964ab ("x86/fpu: Eager switch PKRU state")
>
> ... which I guess the fixes tag would have to mention.
>
> >
> > A kthread with use_mm() would load here non-existing FPU state.
> >
> > Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>
> Given the above, should I add the fixes tag (for 0cecca9d03c964ab)?

Buh. Either that or hch's commit (8d3289f2fa1e0 ("x86/fpu: Don't use
current->mm to check for a kthread").
That will trigger a stable backport (for 5.2) asking what to do about
is_kthread() so please leave a hint to use the PF_ flag like hch did.

Now that I think about it, even if we end up in kthread with use_mm()
then its FPU state is non-existent which means get_xsave_addr() returns
NULL. This is okay / expected but it triggers the WARN_ONCE().

> Thanks,
> Mark.

Sebastian

\
 
 \ /
  Last update: 2019-08-14 16:56    [W:0.035 / U:28.184 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site