lkml.org 
[lkml]   [2021]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch V3 4/6] x86/pkru: Make PKRU=0 actually work
On Tue, Jun 08, 2021 at 09:15:42PM +0200, Thomas Gleixner wrote:
> But if nothing touched the FPU between T1 scheduling out and back in,
> then the fpregs_state is still valid which means switch_fpu_return()
> does nothing and just clears TIF_NEED_FPU_LOAD. Back to user space with
> DEFAULT_PKRU loaded. -> FAIL #2!

Ah ok.

> Why? It was clearly wrong and I can reproduce it with a hack which
> forces a schedule to a kernel thread and it fails all the way back to
> user space.

Oh, I was speculating about some weird luserspace's behavior of clearing
PKRU and then relying on the buggy behavior of getting PKRU restored to
DEFAULT_PKRU.

I know, it is nuts but it is user-visible change. And yeah, probably
nothing does that...

> I chased that because I observed sporadic failures when forcing PKRU to
> init state and then observed the default key being written. I had some
> extra trace_printks there to analyze something completely different :)

As you do. :-)

--
Regards/Gruss,
Boris.

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

\
 
 \ /
  Last update: 2021-06-08 22:07    [W:0.045 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site