1. 19 May, 2018 1 commit
    • Dmitry Safonov's avatar
      x86/mm: Drop TS_COMPAT on 64-bit exec() syscall · acf46020
      Dmitry Safonov authored
      The x86 mmap() code selects the mmap base for an allocation depending on
      the bitness of the syscall. For 64bit sycalls it select mm->mmap_base and
      for 32bit mm->mmap_compat_base.
      
      exec() calls mmap() which in turn uses in_compat_syscall() to check whether
      the mapping is for a 32bit or a 64bit task. The decision is made on the
      following criteria:
      
        ia32    child->thread.status & TS_COMPAT
         x32    child->pt_regs.orig_ax & __X32_SYSCALL_BIT
        ia64    !ia32 && !x32
      
      __set_personality_x32() was dropping TS_COMPAT flag, but
      set_personality_64bit() has kept compat syscall flag making
      in_compat_syscall() return true during the first exec() syscall.
      
      Which in result has user-visible effects, mentioned by Alexey:
      1) It breaks ASAN
      $ gcc -fsanitize=address wrap.c -o wrap-asan
      $ ./wrap32 ./wrap-asan true
      ==1217==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.
      ==1217==ASan shadow was supposed to be located in the [0x00007fff7000-0x10007fff7fff] range.
      ==1217==Process memory map follows:
              0x000000400000-0x000000401000   /home/izbyshev/test/gcc/asan-exec-from-32bit/wrap-asan
              0x000000600000-0x000000601000   /home/izbyshev/test/gcc/asan-exec-from-32bit/wrap-asan
              0x000000601000-0x000000602000   /home/izbyshev/test/gcc/asan-exec-from-32bit/wrap-asan
              0x0000f7dbd000-0x0000f7de2000   /lib64/ld-2.27.so
              0x0000f7fe2000-0x0000f7fe3000   /lib64/ld-2.27.so
              0x0000f7fe3000-0x0000f7fe4000   /lib64/ld-2.27.so
              0x0000f7fe4000-0x0000f7fe5000
              0x7fed9abff000-0x7fed9af54000
              0x7fed9af54000-0x7fed9af6b000   /lib64/libgcc_s.so.1
      [snip]
      
      2) It doesn't seem to be great for security if an attacker always knows
      that ld.so is going to be mapped into the first 4GB in this case
      (the same thing happens for PIEs as well).
      
      The testcase:
      $ cat wrap.c
      
      int main(int argc, char *argv[]) {
        execvp(argv[1], &argv[1]);
        return 127;
      }
      
      $ gcc wrap.c -o wrap
      $ LD_SHOW_AUXV=1 ./wrap ./wrap true |& grep AT_BASE
      AT_BASE:         0x7f63b8309000
      AT_BASE:         0x7faec143c000
      AT_BASE:         0x7fbdb25fa000
      
      $ gcc -m32 wrap.c -o wrap32
      $ LD_SHOW_AUXV=1 ./wrap32 ./wrap true |& grep AT_BASE
      AT_BASE:         0xf7eff000
      AT_BASE:         0xf7cee000
      AT_BASE:         0x7f8b9774e000
      
      Fixes: 1b028f78 ("x86/mm: Introduce mmap_compat_base() for 32-bit mmap()")
      Fixes: ada26481 ("x86/mm: Make in_compat_syscall() work during exec")
      Reported-by: default avatarAlexey Izbyshev <izbyshev@ispras.ru>
      Bisected-by: default avatarAlexander Monakov <amonakov@ispras.ru>
      Investigated-by: default avatarAndy Lutomirski <luto@kernel.org>
      Signed-off-by: default avatarDmitry Safonov <dima@arista.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Alexander Monakov <amonakov@ispras.ru>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: stable@vger.kernel.org
      Cc: linux-mm@kvack.org
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Link: https://lkml.kernel.org/r/20180517233510.24996-1-dima@arista.com
      acf46020
  2. 17 May, 2018 1 commit
  3. 16 May, 2018 2 commits
  4. 14 May, 2018 18 commits
    • Dave Hansen's avatar
      x86/pkeys: Do not special case protection key 0 · 2fa9d1cf
      Dave Hansen authored
      mm_pkey_is_allocated() treats pkey 0 as unallocated.  That is
      inconsistent with the manpages, and also inconsistent with
      mm->context.pkey_allocation_map.  Stop special casing it and only
      disallow values that are actually bad (< 0).
      
      The end-user visible effect of this is that you can now use
      mprotect_pkey() to set pkey=0.
      
      This is a bit nicer than what Ram proposed[1] because it is simpler
      and removes special-casing for pkey 0.  On the other hand, it does
      allow applications to pkey_free() pkey-0, but that's just a silly
      thing to do, so we are not going to protect against it.
      
      The scenario that could happen is similar to what happens if you free
      any other pkey that is in use: it might get reallocated later and used
      to protect some other data.  The most likely scenario is that pkey-0
      comes back from pkey_alloc(), an access-disable or write-disable bit
      is set in PKRU for it, and the next stack access will SIGSEGV.  It's
      not horribly different from if you mprotect()'d your stack or heap to
      be unreadable or unwritable, which is generally very foolish, but also
      not explicitly prevented by the kernel.
      
      1. http://lkml.kernel.org/r/1522112702-27853-1-git-send-email-linuxram@us.ibm.comSigned-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>p
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellermen <mpe@ellerman.id.au>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mm@kvack.org
      Cc: stable@vger.kernel.org
      Fixes: 58ab9a08 ("x86/pkeys: Check against max pkey to avoid overflows")
      Link: http://lkml.kernel.org/r/20180509171358.47FD785E@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      2fa9d1cf
    • Dave Hansen's avatar
      x86/pkeys/selftests: Add a test for pkey 0 · 3488a600
      Dave Hansen authored
      Protection key 0 is the default key for all memory and will
      not normally come back from pkey_alloc().  But, you might
      still want pass it to mprotect_pkey().
      
      This check ensures that you can use pkey 0.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellermen <mpe@ellerman.id.au>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/20180509171356.9E40B254@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      3488a600
    • Dave Hansen's avatar
      x86/pkeys/selftests: Save off 'prot' for allocations · acb25d76
      Dave Hansen authored
      This makes it possible to to tell what 'prot' a given allocation
      is supposed to have.  That way, if we want to change just the
      pkey, we know what 'prot' to pass to mprotect_pkey().
      
      Also, keep a record of the most recent allocation so the tests
      can easily find it.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellermen <mpe@ellerman.id.au>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/20180509171354.AA23E228@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      acb25d76
    • Dave Hansen's avatar
      x86/pkeys/selftests: Fix pointer math · 3d64f4ed
      Dave Hansen authored
      We dump out the entire area of the siginfo where the si_pkey_ptr is
      supposed to be.  But, we do some math on the poitner, which is a u32.
      We intended to do byte math, not u32 math on the pointer.
      
      Cast it over to a u8* so it works.
      
      Also, move this block of code to below th si_code check.  It doesn't
      hurt anything, but the si_pkey field is gibberish for other signal
      types.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellermen <mpe@ellerman.id.au>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/20180509171352.9BE09819@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      3d64f4ed
    • Dave Hansen's avatar
      x86/pkeys: Override pkey when moving away from PROT_EXEC · 0a0b1520
      Dave Hansen authored
      I got a bug report that the following code (roughly) was
      causing a SIGSEGV:
      
      	mprotect(ptr, size, PROT_EXEC);
      	mprotect(ptr, size, PROT_NONE);
      	mprotect(ptr, size, PROT_READ);
      	*ptr = 100;
      
      The problem is hit when the mprotect(PROT_EXEC)
      is implicitly assigned a protection key to the VMA, and made
      that key ACCESS_DENY|WRITE_DENY.  The PROT_NONE mprotect()
      failed to remove the protection key, and the PROT_NONE->
      PROT_READ left the PTE usable, but the pkey still in place
      and left the memory inaccessible.
      
      To fix this, we ensure that we always "override" the pkee
      at mprotect() if the VMA does not have execute-only
      permissions, but the VMA has the execute-only pkey.
      
      We had a check for PROT_READ/WRITE, but it did not work
      for PROT_NONE.  This entirely removes the PROT_* checks,
      which ensures that PROT_NONE now works.
      Reported-by: default avatarShakeel Butt <shakeelb@google.com>
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellermen <mpe@ellerman.id.au>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mm@kvack.org
      Cc: stable@vger.kernel.org
      Fixes: 62b5f7d0 ("mm/core, x86/mm/pkeys: Add execute-only protection keys support")
      Link: http://lkml.kernel.org/r/20180509171351.084C5A71@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      0a0b1520
    • Dave Hansen's avatar
      x86/pkeys/selftests: Fix pkey exhaustion test off-by-one · f50b4878
      Dave Hansen authored
      In our "exhaust all pkeys" test, we make sure that there
      is the expected number available.  Turns out that the
      test did not cover the execute-only key, but discussed
      it anyway.  It did *not* discuss the test-allocated
      key.
      
      Now that we have a test for the mprotect(PROT_EXEC) case,
      this off-by-one issue showed itself.  Correct the off-by-
      one and add the explanation for the case we missed.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellermen <mpe@ellerman.id.au>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/20180509171350.E1656B95@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f50b4878
    • Dave Hansen's avatar
      x86/pkeys/selftests: Add PROT_EXEC test · 6af17cf8
      Dave Hansen authored
      Under the covers, implement executable-only memory with
      protection keys when userspace calls mprotect(PROT_EXEC).
      
      But, we did not have a selftest for that.  Now we do.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellermen <mpe@ellerman.id.au>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/20180509171348.9EEE4BEF@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      6af17cf8
    • Dave Hansen's avatar
      x86/pkeys/selftests: Factor out "instruction page" · 3fcd2b2d
      Dave Hansen authored
      We currently have an execute-only test, but it is for
      the explicit mprotect_pkey() interface.  We will soon
      add a test for the implicit mprotect(PROT_EXEC)
      enterface.  We need this code in both tests.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellermen <mpe@ellerman.id.au>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/20180509171347.C64AB733@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      3fcd2b2d
    • Dave Hansen's avatar
      x86/pkeys/selftests: Allow faults on unknown keys · 7e7fd67c
      Dave Hansen authored
      The exec-only pkey is allocated inside the kernel and userspace
      is not told what it is.  So, allow PK faults to occur that have
      an unknown key.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellermen <mpe@ellerman.id.au>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/20180509171345.7FC7DA00@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      7e7fd67c
    • Dave Hansen's avatar
      x86/pkeys/selftests: Avoid printf-in-signal deadlocks · caf9eb6b
      Dave Hansen authored
      printf() and friends are unusable in signal handlers.  They deadlock.
      The pkey selftest does not do any normal printing in signal handlers,
      only extra debugging.  So, just print the format string so we get
      *some* output when debugging.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellermen <mpe@ellerman.id.au>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/20180509171344.C53FD2F3@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      caf9eb6b
    • Dave Hansen's avatar
      x86/pkeys/selftests: Remove dead debugging code, fix dprint_in_signal · a50093d6
      Dave Hansen authored
      There is some noisy debug code at the end of the signal handler.  It was
      disabled by an early, unconditional "return".  However, that return also
      hid a dprint_in_signal=0, which kept dprint_in_signal=1 and effectively
      locked us into permanent dprint_in_signal=1 behavior.
      
      Remove the return and the dead code, fixing dprint_in_signal.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellermen <mpe@ellerman.id.au>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/20180509171342.846B9B2E@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      a50093d6
    • Dave Hansen's avatar
      x86/pkeys/selftests: Stop using assert() · 86b9eea2
      Dave Hansen authored
      If we use assert(), the program "crashes".  That can be scary to users,
      so stop doing it.  Just exit with a >0 exit code instead.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellermen <mpe@ellerman.id.au>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/20180509171340.E63EF7DA@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      86b9eea2
    • Dave Hansen's avatar
      x86/pkeys/selftests: Give better unexpected fault error messages · 55556b0b
      Dave Hansen authored
      do_not_expect_pk_fault() is a helper that we call when we do not expect
      a PK fault to have occurred.  But, it is a function, which means that
      it obscures the line numbers from pkey_assert().  It also gives no
      details.
      
      Replace it with an implementation that gives nice line numbers and
      also lets callers pass in a more descriptive message about what
      happened that caused the unexpected fault.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellermen <mpe@ellerman.id.au>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/20180509171338.55D13B64@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      55556b0b
    • Andy Lutomirski's avatar
      x86/selftests: Add mov_to_ss test · 59c2a722
      Andy Lutomirski authored
      This exercises a nasty corner case of the x86 ISA.
      Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      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/67e08b69817171da8026e0eb3af0214b06b4d74f.1525800455.git.luto@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      59c2a722
    • Ingo Molnar's avatar
      x86/mpx/selftests: Adjust the self-test to fresh distros that export the MPX ABI · 73bb4d6c
      Ingo Molnar authored
      Fix this warning:
      
        mpx-mini-test.c:422:0: warning: "SEGV_BNDERR" redefined
      
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: akpm@linux-foundation.org
      Cc: dave.hansen@intel.com
      Cc: linux-mm@kvack.org
      Cc: linuxram@us.ibm.com
      Cc: mpe@ellerman.id.au
      Cc: shakeelb@google.com
      Cc: shuah@kernel.org
      Link: http://lkml.kernel.org/r/20180514085908.GA12798@gmail.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      73bb4d6c
    • Ingo Molnar's avatar
      x86/pkeys/selftests: Adjust the self-test to fresh distros that export the pkeys ABI · 0fb96620
      Ingo Molnar authored
      Ubuntu 18.04 started exporting pkeys details in header files, resulting
      in build failures and warnings in the pkeys self-tests:
      
        protection_keys.c:232:0: warning: "SEGV_BNDERR" redefined
        protection_keys.c:387:5: error: conflicting types for ‘pkey_get’
        protection_keys.c:409:5: error: conflicting types for ‘pkey_set’
        ...
      
      Fix these namespace conflicts and double definitions, plus also
      clean up the ABI definitions to make it all a bit more readable ...
      
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: akpm@linux-foundation.org
      Cc: dave.hansen@intel.com
      Cc: linux-mm@kvack.org
      Cc: linuxram@us.ibm.com
      Cc: mpe@ellerman.id.au
      Cc: shakeelb@google.com
      Cc: shuah@kernel.org
      Link: http://lkml.kernel.org/r/20180514085623.GB7094@gmail.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      0fb96620
    • Alexander Potapenko's avatar
      x86/boot/64/clang: Use fixup_pointer() to access '__supported_pte_mask' · 4a09f021
      Alexander Potapenko authored
      Clang builds with defconfig started crashing after the following
      commit:
      
        fb43d6cb ("x86/mm: Do not auto-massage page protections")
      
      This was caused by introducing a new global access in __startup_64().
      
      Code in __startup_64() can be relocated during execution, but the compiler
      doesn't have to generate PC-relative relocations when accessing globals
      from that function. Clang actually does not generate them, which leads
      to boot-time crashes. To work around this problem, every global pointer
      must be adjusted using fixup_pointer().
      Signed-off-by: default avatarAlexander Potapenko <glider@google.com>
      Reviewed-by: default avatarDave Hansen <dave.hansen@intel.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: dvyukov@google.com
      Cc: kirill.shutemov@linux.intel.com
      Cc: linux-mm@kvack.org
      Cc: md@google.com
      Cc: mka@chromium.org
      Fixes: fb43d6cb ("x86/mm: Do not auto-massage page protections")
      Link: http://lkml.kernel.org/r/20180509091822.191810-1-glider@google.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      4a09f021
    • Ingo Molnar's avatar
      objtool, kprobes/x86: Sync the latest <asm/insn.h> header with... · 4fe875e4
      Ingo Molnar authored
      objtool, kprobes/x86: Sync the latest <asm/insn.h> header with tools/objtool/arch/x86/include/asm/insn.h
      
      The following commit:
      
        ee6a7354: kprobes/x86: Prohibit probing on exception masking instructions
      
      Modified <asm/insn.h>, adding the insn_masking_exception() function.
      
      Sync the tooling version of the header to it, to fix this warning:
      
        Warning: synced file at 'tools/objtool/arch/x86/include/asm/insn.h' differs from latest kernel version at 'arch/x86/include/asm/insn.h'
      
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
      Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Yonghong Song <yhs@fb.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: "David S . Miller" <davem@davemloft.net>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      4fe875e4
  5. 13 May, 2018 5 commits
  6. 12 May, 2018 13 commits