1. 29 1月, 2016 2 次提交
  2. 13 1月, 2016 1 次提交
  3. 12 1月, 2016 1 次提交
    • A
      selftests/x86: Disable the ldt_gdt_64 test for now · 0f672809
      Andy Lutomirski 提交于
      ldt_gdt.c relies on cross-cpu invalidation of SS to do one of
      its tests.  On 32-bit builds, this works fine, but on 64-bit
      builds, it only works if the kernel has proper SS sigcontext
      handling for 64-bit user programs.
      
      Since the SS fixes are currently reverted, restrict the test
      case to 32 bits for now.
      
      In principle, I could change the test to use a different segment
      register, but it would be messy: CS can't point to the LDT for
      64-bit code, and the other registers don't result in immediate
      faults because they aren't reloaded on kernel -> user
      transitions.
      
      When we fix sigcontext (in 4.6?), we can revert this.
      Signed-off-by: NAndy Lutomirski <luto@kernel.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      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: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/231591d9122d282402d8f53175134f8db5b3bc73.1452561752.git.luto@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      0f672809
  4. 07 10月, 2015 2 次提交
  5. 20 9月, 2015 2 次提交
  6. 18 9月, 2015 1 次提交
    • D
      x86/asm/entry/32, selftests: Add 'test_syscall_vdso' test · c25be94f
      Denys Vlasenko 提交于
      This new test checks that all x86 registers are preserved across
      32-bit syscalls. It tests syscalls through VDSO (if available)
      and through INT 0x80, normally and under ptrace.
      
      If kernel is a 64-bit one, high registers (r8..r15) are poisoned
      before the syscall is called and are checked afterwards.
      
      They must be either preserved, or cleared to zero (but r11 is
      special); r12..15 must be preserved for INT 0x80.
      
      EFLAGS is checked for changes too, but change there is not
      considered to be a bug (paravirt kernels do not preserve
      arithmetic flags).
      
      Run-tested on 64-bit kernel:
      
      	$ ./test_syscall_vdso_32
      	[RUN]	Executing 6-argument 32-bit syscall via VDSO
      	[OK]	Arguments are preserved across syscall
      	[NOTE]	R11 has changed:0000000000200ed7 - assuming clobbered by
      	SYSRET insn [OK]	R8..R15 did not leak kernel data
      	[RUN]	Executing 6-argument 32-bit syscall via INT 80
      	[OK]	Arguments are preserved across syscall
      	[OK]	R8..R15 did not leak kernel data
      	[RUN]	Running tests under ptrace
      	[RUN]	Executing 6-argument 32-bit syscall via VDSO
      	[OK]	Arguments are preserved across syscall
      	[OK]	R8..R15 did not leak kernel data
      	[RUN]	Executing 6-argument 32-bit syscall via INT 80
      	[OK]	Arguments are preserved across syscall
      	[OK]	R8..R15 did not leak kernel data
      
      On 32-bit paravirt kernel:
      
      	$ ./test_syscall_vdso_32
      	[NOTE]	Not a 64-bit kernel, won't test R8..R15 leaks
      	[RUN]	Executing 6-argument 32-bit syscall via VDSO
      	[WARN]	Flags before=0000000000200ed7 id 0 00 o d i s z 0 a 0 p 1 c
      	[WARN]	Flags  after=0000000000200246 id 0 00 i z 0 0 p 1
      	[WARN]	Flags change=0000000000000c91 0 00 o d s 0 a 0 0 c
      	[OK]	Arguments are preserved across syscall
      	[RUN]	Executing 6-argument 32-bit syscall via INT 80
      	[OK]	Arguments are preserved across syscall
      	[RUN]	Running tests under ptrace
      	[RUN]	Executing 6-argument 32-bit syscall via VDSO
      	[OK]	Arguments are preserved across syscall
      	[RUN]	Executing 6-argument 32-bit syscall via INT 80
      	[OK]	Arguments are preserved across syscall
      Signed-off-by: NDenys Vlasenko <dvlasenk@redhat.com>
      Acked-by: NAndy Lutomirski <luto@amacapital.net>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Kees Cook <keescook@chromium.org>
      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: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Drewry <wad@chromium.org>
      Cc: linux-kernel@vger.kernel.org
      Link: http://lkml.kernel.org/r/1442427809-2027-1-git-send-email-dvlasenk@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      c25be94f
  7. 18 8月, 2015 2 次提交
  8. 31 7月, 2015 1 次提交
  9. 07 7月, 2015 1 次提交
    • A
      x86/entry, selftests/x86: Add a test for 32-bit fast syscall arg faults · 5e5c684a
      Andy Lutomirski 提交于
      This test passes on 4.0 and fails on some newer kernels.
      Fortunately, the failure is likely not a big deal.
      
      This test will make sure that we don't break it further (e.g. OOPSing)
      as we clean up the entry code and that we eventually fix the
      regression.
      
      There's arguably no need to preserve the old ABI here --
      anything that makes it into a fast (vDSO) syscall with a bad
      stack is about to crash no matter what we do.
      Signed-off-by: NAndy Lutomirski <luto@kernel.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Denys Vlasenko <vda.linux@googlemail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: paulmck@linux.vnet.ibm.com
      Link: http://lkml.kernel.org/r/9cfcc51005168cb1b06b31991931214d770fc59a.1435952415.git.luto@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      5e5c684a
  10. 30 5月, 2015 1 次提交
  11. 13 5月, 2015 5 次提交
  12. 08 5月, 2015 1 次提交
  13. 16 4月, 2015 1 次提交
  14. 08 4月, 2015 1 次提交
    • A
      x86, selftests: Add sigreturn selftest · 3f705dfd
      Andy Lutomirski 提交于
      This is my sigreturn test, added mostly unchanged from its old
      home. It exercises the sigreturn(2) syscall, specifically
      focusing on its interactions with various IRET corner cases.
      
      It tests for correct behavior in several areas that were
      historically dangerously buggy. For example, it exercises espfix
      on kernels of both bitnesses under various conditions, and it
      contains testcases for several now-fixed bugs in IRET error
      handling.
      
      If you run it on older kernels without the fixes, your system will
      crash. It probably won't eat your data in the process.
      
      There is no released kernel on which the sigreturn_64 test will
      pass, but it passes on tip:x86/asm.
      
      I plan to switch to lib.mk for Linux 4.2.
      
      I'm not using the ksft_ helpers at all yet.  I can do that later.
      Signed-off-by: NAndy Lutomirski <luto@kernel.org>
      Acked-by: NShuah Khan <shuahkh@osg.samsung.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Denys Vlasenko <vda.linux@googlemail.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Shuah Khan <shuah.kh@samsung.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/89d10b76b92c7202d8123654dc8d36701c017b3d.1428386971.git.luto@kernel.org
      [ Fixed empty format string GCC build warning in trivial_32bit_program.c ]
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      3f705dfd