1. 15 4月, 2016 1 次提交
  2. 30 3月, 2016 2 次提交
  3. 17 3月, 2016 1 次提交
  4. 10 3月, 2016 1 次提交
  5. 02 3月, 2016 5 次提交
  6. 26 2月, 2016 6 次提交
  7. 20 2月, 2016 2 次提交
  8. 17 2月, 2016 4 次提交
    • A
      selftests/x86: Add a test for syscall restart under ptrace · 40361343
      Andy Lutomirski 提交于
      This catches a regression from the compat syscall rework.  The
      32-bit variant of this test currently fails.  The issue is that, for
      a 32-bit tracer and a 32-bit tracee, GETREGS+SETREGS with no changes
      should be a no-op.  It currently isn't a no-op if RAX indicates
      signal restart, because the high bits get cleared and the kernel
      loses track of the restart state.
      Reported-by: NRobert O'Callahan <robert@ocallahan.org>
      Signed-off-by: NAndy Lutomirski <luto@kernel.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      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/c4040b40b5b4a37ed31375a69b683f753ec6788a.1455142412.git.luto@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      40361343
    • A
      selftests/x86: Fix some error messages in ptrace_syscall · adcfd23e
      Andy Lutomirski 提交于
      I had some obvious typos.
      Signed-off-by: NAndy Lutomirski <luto@kernel.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      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: Robert O'Callahan <robert@ocallahan.org>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/e5e6772d4802986cf7df702e646fa24ac14f2204.1455142412.git.luto@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      adcfd23e
    • A
      selftests/x86: Add tests for UC_SIGCONTEXT_SS and UC_STRICT_RESTORE_SS · 4f6c8938
      Andy Lutomirski 提交于
      This tests the two ABI-preserving cases that DOSEMU cares about, and
      it also explicitly tests the new UC_SIGCONTEXT_SS and
      UC_STRICT_RESTORE_SS flags.
      Signed-off-by: NAndy Lutomirski <luto@kernel.org>
      Acked-by: NBorislav Petkov <bp@alien8.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Cyrill Gorcunov <gorcunov@gmail.com>
      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: Pavel Emelyanov <xemul@parallels.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Stas Sergeev <stsp@list.ru>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/f3d08f98541d0bd3030ceb35e05e21f59e30232c.1455664054.git.luto@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      4f6c8938
    • A
      x86/signal/64: Re-add support for SS in the 64-bit signal context · 6c25da5a
      Andy Lutomirski 提交于
      This is a second attempt to make the improvements from c6f20629
      ("x86/signal/64: Fix SS handling for signals delivered to 64-bit
      programs"), which was reverted by 51adbfbba5c6 ("x86/signal/64: Add
      support for SS in the 64-bit signal context").
      
      This adds two new uc_flags flags.  UC_SIGCONTEXT_SS will be set for
      all 64-bit signals (including x32).  It indicates that the saved SS
      field is valid and that the kernel supports the new behavior.
      
      The goal is to fix a problems with signal handling in 64-bit tasks:
      SS wasn't saved in the 64-bit signal context, making it awkward to
      determine what SS was at the time of signal delivery and making it
      impossible to return to a non-flat SS (as calling sigreturn clobbers
      SS).
      
      This also made it extremely difficult for 64-bit tasks to return to
      fully-defined 16-bit contexts, because only the kernel can easily do
      espfix64, but sigreturn was unable to set a non-flag SS:ESP.
      (DOSEMU has a monstrous hack to partially work around this
      limitation.)
      
      If we could go back in time, the correct fix would be to make 64-bit
      signals work just like 32-bit signals with respect to SS: save it
      in signal context, reset it when delivering a signal, and restore
      it in sigreturn.
      
      Unfortunately, doing that (as I tried originally) breaks DOSEMU:
      DOSEMU wouldn't reset the signal context's SS when clearing the LDT
      and changing the saved CS to 64-bit mode, since it predates the SS
      context field existing in the first place.
      
      This patch is a bit more complicated, and it tries to balance a
      bunch of goals.  It makes most cases of changing ucontext->ss during
      signal handling work as expected.
      
      I do this by special-casing the interesting case.  On sigreturn,
      ucontext->ss will be honored by default, unless the ucontext was
      created from scratch by an old program and had a 64-bit CS
      (unfortunately, CRIU can do this) or was the result of changing a
      32-bit signal context to 64-bit without resetting SS (as DOSEMU
      does).
      
      For the benefit of new 64-bit software that uses segmentation (new
      versions of DOSEMU might), the new behavior can be detected with a
      new ucontext flag UC_SIGCONTEXT_SS.
      
      To avoid compilation issues, __pad0 is left as an alias for ss in
      ucontext.
      
      The nitty-gritty details are documented in the header file.
      
      This patch also re-enables the sigreturn_64 and ldt_gdt_64 selftests,
      as the kernel change allows both of them to pass.
      Tested-by: NStas Sergeev <stsp@list.ru>
      Signed-off-by: NAndy Lutomirski <luto@kernel.org>
      Acked-by: NBorislav Petkov <bp@alien8.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Cyrill Gorcunov <gorcunov@gmail.com>
      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: Pavel Emelyanov <xemul@parallels.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/749149cbfc3e75cd7fcdad69a854b399d792cc6f.1455664054.git.luto@kernel.org
      [ Small readability edit. ]
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      6c25da5a
  9. 15 2月, 2016 1 次提交
  10. 11 2月, 2016 2 次提交
  11. 29 1月, 2016 2 次提交
  12. 26 1月, 2016 4 次提交
  13. 13 1月, 2016 1 次提交
  14. 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
  15. 11 1月, 2016 1 次提交
    • M
      selftests/seccomp: Remove the need for HAVE_ARCH_TRACEHOOK · 4a0b8807
      Mickaël Salaün 提交于
      Some architectures do not implement PTRACE_GETREGSET nor
      PTRACE_SETREGSET (required by HAVE_ARCH_TRACEHOOK) but only implement
      PTRACE_GETREGS and PTRACE_SETREGS (e.g. User-mode Linux).
      
      This improve seccomp selftest portability for architectures without
      HAVE_ARCH_TRACEHOOK support by defining a new trigger HAVE_GETREGS. For
      now, this is only enabled for i386 and x86_64 architectures. This is
      required to be able to run this tests on User-mode Linux.
      Signed-off-by: NMickaël Salaün <mic@digikod.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Will Drewry <wad@chromium.org>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Meredydd Luff <meredydd@senatehouse.org>
      Cc: David Drysdale <drysdale@google.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Acked-by: NKees Cook <keescook@chromium.org>
      4a0b8807
  16. 08 1月, 2016 6 次提交