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 Wed, Aug 14, 2019 at 03:07:08PM +0200, Sebastian Andrzej Siewior wrote:
> On 2019-08-14 11:41:30 [+0100], Mark Rutland wrote:
> > Per commit:
> >
> > 0cecca9d03c964ab ("x86/fpu: Eager switch PKRU state")
> >
> > ... switch_fpu_state() is trying to distinguish user threads from
> > kthreads, such that kthreads consistently use init_pkru_value. It does
> > do by looking at current->mm.
> >
> > In general, a non-NULL current->mm doesn't imply that current is a
> > kthread, as kthreads can install an mm via use_mm(), and so it's
> > preferable to use is_kthread() to determine whether a thread is a
> > kthread.
>
> 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)?

Thanks,
Mark.

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