selftests/x86: Add a test for syscall restart under ptrace
authorAndy Lutomirski <luto@kernel.org>
Wed, 10 Feb 2016 22:15:26 +0000 (14:15 -0800)
committerIngo Molnar <mingo@kernel.org>
Wed, 17 Feb 2016 08:51:06 +0000 (09:51 +0100)
commit403613432222549727e5d70cf44da8987653202a
treecf1ea1a33706d3015e6bb19e7c208309c385020b
parentadcfd23ead69965e3ac3e69f56451dab5e39157a
selftests/x86: Add a test for syscall restart under ptrace

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: Robert O'Callahan <robert@ocallahan.org>
Signed-off-by: Andy 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.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
tools/testing/selftests/x86/ptrace_syscall.c