1. 08 Jul, 2016 1 commit
  2. 14 Jun, 2016 4 commits
    • Dave Hansen's avatar
      x86/mpx, selftests: Add MPX self test · e754aedc
      Dave Hansen authored
      I've had this code for a while, but never submitted it upstream.  Now
      that Skylake hardware is out in the wild, folks can actually run this
      for real.  It tests the following:
      
      	1. The MPX hardware is enabled by the kernel and doing what it
      	   is supposed to
      	2. The MPX management code is present and enabled in the kernel
      	3. MPX Signal handling
      	4. The MPX bounds table population code (on-demand population)
      	5. The MPX bounds table unmapping code (kernel-initiated freeing
      	   when unused)
      
      This has also caught bugs in the XSAVE code because MPX state is
      saved/restored with XSAVE.
      
      I'm submitting it now because it would have caught the recent issues
      with the compat_siginfo code not being properly augmented when new
      siginfo state is added.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave@sr71.net>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20160608172535.5B40B0EE@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      e754aedc
    • Dave Hansen's avatar
      x86/signals: Add build-time checks to the siginfo compat code · 02e8fda2
      Dave Hansen authored
      There were at least 3 features added to the __SI_FAULT area of the
      siginfo struct that did not make it to the compat siginfo:
      
      	1. The si_addr_lsb used in SIGBUS's sent for machine checks
      	2. The upper/lower bounds for MPX SIGSEGV faults
      	3. The protection key for pkey faults
      
      There was also some turmoil when I was attempting to add the pkey
      field because it needs to be a fixed size on 32 and 64-bit and
      not have any alignment constraints.
      
      This patch adds some compile-time checks to the compat code to
      make it harder to screw this up.  Basically, the checks are
      supposed to trip any time someone changes the siginfo structure.
      That sounds bad, but it's what we want.  If someone changes
      siginfo, we want them to also be _forced_ to go look at the
      compat code.
      
      The details are in the comments.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave@sr71.net>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: linux-edac@vger.kernel.org
      Link: http://lkml.kernel.org/r/20160608172534.C73DAFC3@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      02e8fda2
    • Dave Hansen's avatar
      x86/signals: Add missing signal_compat code for x86 features · a4455082
      Dave Hansen authored
      The 32-bit siginfo is a different binary format than the 64-bit
      one.  So, when running 32-bit binaries on 64-bit kernels, we have
      to convert the kernel's 64-bit version to a 32-bit version that
      userspace can grok.
      
      We've added a few features to siginfo over the past few years and
      neglected to add them to arch/x86/kernel/signal_compat.c:
      
         1. The si_addr_lsb used in SIGBUS's sent for machine checks
         2. The upper/lower bounds for MPX SIGSEGV faults
         3. The protection key for pkey faults
      
      I caught this with some protection keys unit tests and realized
      it affected a few more features.
      
      This was tested only with my protection keys patch that looks
      for a proper value in si_pkey.  I didn't actually test the machine
      check or MPX code.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave@sr71.net>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: linux-edac@vger.kernel.org
      Link: http://lkml.kernel.org/r/20160608172533.F8F05637@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      a4455082
    • Andy Lutomirski's avatar
      x86/vdso/32: Assemble sigreturn.S separately · f0702555
      Andy Lutomirski authored
      sigreturn.S was historically included by the various
      __kernel_vsyscall implementations due to assumptions about all the
      32-bit vDSO images having the sigreturn symbols at the same address.
      
      Those assumptions were removed in v3.16, and as of v4.4, there is only
      a single 32-bit vDSO left.
      
      Simplify the build process by assembling sigreturn.S into a normal
      object file.
      Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/d7b6dfde3c7397aa26977320da90448363b5a7e9.1465505753.git.luto@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f0702555
  3. 11 Jun, 2016 2 commits
  4. 10 Jun, 2016 33 commits