Skip to content

x86/fpu: math_state_restore() should not blindly disable irqs

Oleg Nesterov lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 31 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1x86/fpu: math_state_restore() should not blindly disable irqsarch/x86/kernel/traps.c+7 -224 replies
1/1x86/fpu: x86/fpu: avoid math_state_restore() without used_math() in __restore_xstate_sig()arch/x86/kernel/xsave.c+4 -37 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] x86/fpu: math_state_restore() should not blindly disable irqs
Quoted 3 lines · Oleg Nesterov

And this also means I have another off-topic fix for 4.0/stable, will send a patch in a minute...

I knew about this problem, but I didn't realize that restore_sigcontext() can call a sleeping function after math_state_restore(). So I was going to fix this later, because we need a lot more cleanups in these paths.

But it turns out, it is trivial to trigger the "BUG: sleeping function called from invalid context" warning, see the test-case I sent to Dave.

To avoid the confusion, this has nothing to do with the problems we discuss in other threads, or with the recent changes in tip/x86/fpu.

The patch is horrible, yes. But simple, and math_state_restore/init_fpu are already horrible and need the cleanups. Hopefully I'll send them "soon".

Oleg.