Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux...
[cascardo/linux.git] / arch / arm64 / kernel / ptrace.c
index 030c1d5..e0c81da 100644 (file)
@@ -1347,13 +1347,13 @@ static void tracehook_report_syscall(struct pt_regs *regs,
 
 asmlinkage int syscall_trace_enter(struct pt_regs *regs)
 {
-       /* Do the secure computing check first; failures should be fast. */
-       if (secure_computing() == -1)
-               return -1;
-
        if (test_thread_flag(TIF_SYSCALL_TRACE))
                tracehook_report_syscall(regs, PTRACE_SYSCALL_ENTER);
 
+       /* Do the secure computing after ptrace; failures should be fast. */
+       if (secure_computing(NULL) == -1)
+               return -1;
+
        if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
                trace_sys_enter(regs, regs->syscallno);