]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Nov 2015 02:59:10 +0000 (18:59 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Nov 2015 02:59:10 +0000 (18:59 -0800)
Pull x86 asm changes from Ingo Molnar:
 "The main change in this cycle is another step in the big x86 system
  call interface rework by Andy Lutomirski, which moves most of the low
  level x86 entry code from assembly to C, for all syscall entries
  except native 64-bit system calls:

    arch/x86/entry/entry_32.S        | 182 ++++------
    arch/x86/entry/entry_64_compat.S | 547 ++++++++-----------------------
    194 insertions(+), 535 deletions(-)

  ... our hope is that the final remaining step (converting native
  64-bit system calls) will be less painful as all the previous steps,
  given that most of the legacies and quirks are concentrated around
  native 32-bit and compat environments"

* 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (47 commits)
  x86/entry/32: Fix FS and GS restore in opportunistic SYSEXIT
  x86/entry/32: Fix entry_INT80_32() to expect interrupts to be on
  um/x86: Fix build after x86 syscall changes
  x86/asm: Remove the xyz_cfi macros from dwarf2.h
  selftests/x86: Style fixes for the 'unwind_vdso' test
  x86/entry/64/compat: Document sysenter_fix_flags's reason for existence
  x86/entry: Split and inline syscall_return_slowpath()
  x86/entry: Split and inline prepare_exit_to_usermode()
  x86/entry: Use pt_regs_to_thread_info() in syscall entry tracing
  x86/entry: Hide two syscall entry assertions behind CONFIG_DEBUG_ENTRY
  x86/entry: Micro-optimize compat fast syscall arg fetch
  x86/entry: Force inlining of 32-bit syscall code
  x86/entry: Make irqs_disabled checks in exit code depend on lockdep
  x86/entry: Remove unnecessary IRQ twiddling in fast 32-bit syscalls
  x86/asm: Remove thread_info.sysenter_return
  x86/entry/32: Re-implement SYSENTER using the new C path
  x86/entry/32: Switch INT80 to the new C syscall path
  x86/entry/32: Open-code return tracking from fork and kthreads
  x86/entry/compat: Implement opportunistic SYSRETL for compat syscalls
  x86/vdso/compat: Wire up SYSENTER and SYSCSALL for compat userspace
  ...

1  2 
arch/x86/Kconfig
arch/x86/include/asm/thread_info.h

diff --combined arch/x86/Kconfig
index 255ea22ccbec509ead6325098863a50587ecae99,9bfb9e15a6e846cf584cfcf8b2035bdf7d413a8d..db3622f22b618303a8bc9c3c2f34762f400dbafb
@@@ -1123,10 -1123,8 +1123,10 @@@ config X86_REBOOTFIXUP
          Say N otherwise.
  
  config MICROCODE
 -      tristate "CPU microcode loading support"
 +      bool "CPU microcode loading support"
 +      default y
        depends on CPU_SUP_AMD || CPU_SUP_INTEL
 +      depends on BLK_DEV_INITRD
        select FW_LOADER
        ---help---
  
@@@ -1168,6 -1166,24 +1168,6 @@@ config MICROCODE_OLD_INTERFAC
        def_bool y
        depends on MICROCODE
  
 -config MICROCODE_INTEL_EARLY
 -      bool
 -
 -config MICROCODE_AMD_EARLY
 -      bool
 -
 -config MICROCODE_EARLY
 -      bool "Early load microcode"
 -      depends on MICROCODE=y && BLK_DEV_INITRD
 -      select MICROCODE_INTEL_EARLY if MICROCODE_INTEL
 -      select MICROCODE_AMD_EARLY if MICROCODE_AMD
 -      default y
 -      help
 -        This option provides functionality to read additional microcode data
 -        at the beginning of initrd image. The data tells kernel to load
 -        microcode to CPU's as early as possible. No functional change if no
 -        microcode data is glued to the initrd, therefore it's safe to say Y.
 -
  config X86_MSR
        tristate "/dev/cpu/*/msr - Model-specific register support"
        ---help---
@@@ -1292,7 -1308,6 +1292,7 @@@ config HIGHME
  config X86_PAE
        bool "PAE (Physical Address Extension) Support"
        depends on X86_32 && !HIGHMEM4G
 +      select SWIOTLB
        ---help---
          PAE is required for NX support, and furthermore enables
          larger swapspace support for non-overcommit purposes. It
@@@ -2027,6 -2042,55 +2027,55 @@@ config COMPAT_VDS
          If unsure, say N: if you are compiling your own kernel, you
          are unlikely to be using a buggy version of glibc.
  
+ choice
+       prompt "vsyscall table for legacy applications"
+       depends on X86_64
+       default LEGACY_VSYSCALL_EMULATE
+       help
+         Legacy user code that does not know how to find the vDSO expects
+         to be able to issue three syscalls by calling fixed addresses in
+         kernel space. Since this location is not randomized with ASLR,
+         it can be used to assist security vulnerability exploitation.
+         This setting can be changed at boot time via the kernel command
+         line parameter vsyscall=[native|emulate|none].
+         On a system with recent enough glibc (2.14 or newer) and no
+         static binaries, you can say None without a performance penalty
+         to improve security.
+         If unsure, select "Emulate".
+       config LEGACY_VSYSCALL_NATIVE
+               bool "Native"
+               help
+                 Actual executable code is located in the fixed vsyscall
+                 address mapping, implementing time() efficiently. Since
+                 this makes the mapping executable, it can be used during
+                 security vulnerability exploitation (traditionally as
+                 ROP gadgets). This configuration is not recommended.
+       config LEGACY_VSYSCALL_EMULATE
+               bool "Emulate"
+               help
+                 The kernel traps and emulates calls into the fixed
+                 vsyscall address mapping. This makes the mapping
+                 non-executable, but it still contains known contents,
+                 which could be used in certain rare security vulnerability
+                 exploits. This configuration is recommended when userspace
+                 still uses the vsyscall area.
+       config LEGACY_VSYSCALL_NONE
+               bool "None"
+               help
+                 There will be no vsyscall mapping at all. This will
+                 eliminate any risk of ASLR bypass due to the vsyscall
+                 fixed address mapping. Attempts to use the vsyscalls
+                 will be reported to dmesg, so that either old or
+                 malicious userspace programs can be identified.
+ endchoice
  config CMDLINE_BOOL
        bool "Built-in kernel command line"
        ---help---
index 809877e9030b4680097edbbb53009511eb758396,a1ecd214d2279e49ba9bd9d0c8e8d62536142fba..c7b551028740f18a5360070a6ccb5dc9ad714c5e
@@@ -57,8 -57,8 +57,7 @@@ struct thread_info 
        __u32                   flags;          /* low level flags */
        __u32                   status;         /* thread synchronous flags */
        __u32                   cpu;            /* current CPU */
 -      int                     saved_preempt_count;
        mm_segment_t            addr_limit;
-       void __user             *sysenter_return;
        unsigned int            sig_on_uaccess_error:1;
        unsigned int            uaccess_err:1;  /* uaccess failed */
  };
@@@ -68,6 -68,7 +67,6 @@@
        .task           = &tsk,                 \
        .flags          = 0,                    \
        .cpu            = 0,                    \
 -      .saved_preempt_count = INIT_PREEMPT_COUNT,      \
        .addr_limit     = KERNEL_DS,            \
  }