x86/ptrace: run seccomp after ptrace
authorKees Cook <keescook@chromium.org>
Thu, 9 Jun 2016 19:36:50 +0000 (12:36 -0700)
committerKees Cook <keescook@chromium.org>
Tue, 14 Jun 2016 17:54:41 +0000 (10:54 -0700)
commit93e35efb8de45393cf61ed07f7b407629bf698ea
tree862d7e65445f7c7a53025fbfc097eb9e4f363715
parentce6526e8afa4b6ad0ab134a4cc50c9c863319637
x86/ptrace: run seccomp after ptrace

This moves seccomp after ptrace on x86 to that seccomp can catch changes
made by ptrace. Emulation should skip the rest of processing too.

We can get rid of test_thread_flag because there's no longer any
opportunity for seccomp to mess with ptrace state before invoking
ptrace.

Suggested-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: x86@kernel.org
Cc: Andy Lutomirski <luto@kernel.org>
arch/x86/entry/common.c