public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>
Subject: x86: MPX and signal handlers
Date: Tue, 03 Mar 2015 15:27:17 -0800	[thread overview]
Message-ID: <54F64355.3090808@intel.com> (raw)

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?

                 reply	other threads:[~2015-03-03 23:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54F64355.3090808@intel.com \
    --to=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox