public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] x86, fpu: shift drop_init_fpu() from save_xstate_sig() to handle_signal()
@ 2014-08-22 17:11 Oleg Nesterov
  2014-08-22 17:12 ` [PATCH 1/1] " Oleg Nesterov
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Oleg Nesterov @ 2014-08-22 17:11 UTC (permalink / raw)
  To: Al Viro, Andrew Morton, Linus Torvalds
  Cc: Bean Anderson, H. Peter Anvin, Ingo Molnar, Thomas Gleixner, x86,
	linux-kernel

Al, Linus, could you take a look?

Looks simple, but I have to admit that every time I read FPU code
I feel that I never read it before. And I never really understood
it in details.

See the changelog, but in short drop_init_fpu() in save_xstate_sig()
looks wrong. This assumes that we are going to call the handler and
thus we need the new FPU state. But this is only true if setup_frame()
won't fail after that. If it fails, we simply lose the FPU state.

Many thanks to Bean Anderson for the detailed report, let me quote it:

	(1) A real-time signal is being delivered to a thread.
	(2) There is not enough room to push the ucontext on the
	    stack so a SIGSEGV is generated
	(3) The segv handler is running on the sigaltstack.
	(4) The ucontext received by the segv handler does not contain
	    the FP registers. And on return from the segv handler, the
	    existing FP registers appear to be zero'd out.

Oleg.


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2014-09-02  5:01 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-22 17:11 [PATCH 0/1] x86, fpu: shift drop_init_fpu() from save_xstate_sig() to handle_signal() Oleg Nesterov
2014-08-22 17:12 ` [PATCH 1/1] " Oleg Nesterov
2014-08-24 19:47 ` [PATCH 0/5] x86, fpu: make use_eager_fpu() more eager Oleg Nesterov
2014-08-24 19:47   ` [PATCH 1/5] x86, fpu: change sanitize_restored_xstate() and convert_to_fxsr() to accept thread_xstate Oleg Nesterov
2014-08-24 19:47   ` [PATCH 2/5] x86, fpu: don't drop_fpu() in __restore_xstate_sig() if use_eager_fpu() Oleg Nesterov
2014-08-24 20:05     ` Linus Torvalds
2014-08-25 14:26       ` Oleg Nesterov
2014-08-25 14:41       ` Oleg Nesterov
2014-08-25 16:27         ` Linus Torvalds
2014-08-25 17:09           ` Oleg Nesterov
2014-08-25 17:26             ` Linus Torvalds
2014-08-25 17:39               ` Oleg Nesterov
2014-08-27 17:02                 ` Oleg Nesterov
2014-08-24 19:47   ` [PATCH 3/5] x86, fpu: don't drop_fpu() in exit_thread() " Oleg Nesterov
2014-08-24 19:47   ` [PATCH 4/5] x86, fpu: shift init_fpu() from eager_fpu_init() to eager_fpu_init_bp() Oleg Nesterov
2014-08-24 19:47   ` [PATCH 5/5] x86, fpu: sanitize the usage of use_eager_fpu() in switch_fpu_prepare() Oleg Nesterov
2014-08-25 18:08 ` [PATCH] x86, fpu: __restore_xstate_sig()->math_state_restore() needs preempt_disable() Oleg Nesterov
2014-09-02  5:01   ` Suresh Siddha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox