|
@@ -821,15 +821,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
|
|
|
|
|
|
asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
|
|
asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
|
|
{
|
|
{
|
|
- long ret = 0;
|
|
|
|
-
|
|
|
|
- /* Do the secure computing check first. */
|
|
|
|
- if (secure_computing(NULL)) {
|
|
|
|
- /* seccomp failures shouldn't expose any additional code. */
|
|
|
|
- ret = -1;
|
|
|
|
- goto out;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* The sysc_tracesys code in entry.S stored the system
|
|
* The sysc_tracesys code in entry.S stored the system
|
|
* call number to gprs[2].
|
|
* call number to gprs[2].
|
|
@@ -843,7 +834,13 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
|
|
* the system call and the system call restart handling.
|
|
* the system call and the system call restart handling.
|
|
*/
|
|
*/
|
|
clear_pt_regs_flag(regs, PIF_SYSCALL);
|
|
clear_pt_regs_flag(regs, PIF_SYSCALL);
|
|
- ret = -1;
|
|
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /* Do the secure computing check after ptrace. */
|
|
|
|
+ if (secure_computing(NULL)) {
|
|
|
|
+ /* seccomp failures shouldn't expose any additional code. */
|
|
|
|
+ return -1;
|
|
}
|
|
}
|
|
|
|
|
|
if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
|
|
if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
|
|
@@ -852,8 +849,8 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
|
|
audit_syscall_entry(regs->gprs[2], regs->orig_gpr2,
|
|
audit_syscall_entry(regs->gprs[2], regs->orig_gpr2,
|
|
regs->gprs[3], regs->gprs[4],
|
|
regs->gprs[3], regs->gprs[4],
|
|
regs->gprs[5]);
|
|
regs->gprs[5]);
|
|
-out:
|
|
|
|
- return ret ?: regs->gprs[2];
|
|
|
|
|
|
+
|
|
|
|
+ return regs->gprs[2];
|
|
}
|
|
}
|
|
|
|
|
|
asmlinkage void do_syscall_trace_exit(struct pt_regs *regs)
|
|
asmlinkage void do_syscall_trace_exit(struct pt_regs *regs)
|