x86/ptrace: Stop setting TS_COMPAT in ptrace code
authorAndy Lutomirski <luto@kernel.org>
Wed, 27 Jul 2016 06:12:22 +0000 (23:12 -0700)
committerIngo Molnar <mingo@kernel.org>
Wed, 27 Jul 2016 09:09:43 +0000 (11:09 +0200)
commit609c19a385c8744c41f944e2a2d8afe8e8fb860e
tree34e6a36adf4ec420dca05a5cf2c7d83c2a195ca3
parent37e13a1ebe32c4fbfbdb5413f42eb6e71d8b28a4
x86/ptrace: Stop setting TS_COMPAT in ptrace code

Setting TS_COMPAT in ptrace is wrong: if we happen to do it during
syscall entry, then we'll confuse seccomp and audit.  (The former
isn't a security problem: seccomp is currently entirely insecure if a
malicious ptracer is attached.)  As a minimal fix, this patch adds a
new flag TS_I386_REGS_POKED that handles the ptrace special case.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
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: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Pedro Alves <palves@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/5383ebed38b39fa37462139e337aff7f2314d1ca.1469599803.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/entry/common.c
arch/x86/include/asm/syscall.h
arch/x86/include/asm/thread_info.h
arch/x86/kernel/ptrace.c
arch/x86/kernel/signal.c