public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* x86: MPX and signal handlers
@ 2015-03-03 23:27 Dave Hansen
  0 siblings, 0 replies; only message in thread
From: Dave Hansen @ 2015-03-03 23:27 UTC (permalink / raw)
  To: H. Peter Anvin, Thomas Gleixner, LKML

In handle_signal(), while we are setting up to call a signal handler, we do:
              /*
               * Ensure the signal handler starts with the new fpustate.
               */
              if (used_math())
                      drop_init_fpu(current);

Where drop_init_fpu() actually restores us to the 'init' FPU state
where, of course, MPX will be turned off.

I guess userspace can still just re-enable MPX first thing in its signal
handlers if it really cares, but that definitely breaks the idea that
MPX support can be added with a simple recompilation.

The alternative would be to jam the original configuration register
value (BNDCFGU) in to the signal handler's FPU state from inside the
kernel before calling out to the signal handler.

I _think_ we can just leave it alone and document that you don't get MPX
protections by default in signal handlers.  Does anybody disagree?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-03 23:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-03 23:27 x86: MPX and signal handlers Dave Hansen

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