asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
{
- long ret = 0;
+ unsigned long mask = -1UL;
+
- /* Do the secure computing check first. */
- if (secure_computing()) {
- /* seccomp failures shouldn't expose any additional code. */
- ret = -1;
- goto out;
- }
-
/*
* The sysc_tracesys code in entry.S stored the system
* call number to gprs[2].
if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
trace_sys_enter(regs, regs->gprs[2]);
- audit_syscall_entry(regs->gprs[2], regs->orig_gpr2,
- regs->gprs[3], regs->gprs[4],
- regs->gprs[5]);
+ if (is_compat_task())
+ mask = 0xffffffff;
+
+ audit_syscall_entry(regs->gprs[2], regs->orig_gpr2 & mask,
- regs->gprs[3] & mask, regs->gprs[4] & mask,
- regs->gprs[5] & mask);
-out:
- return ret ?: regs->gprs[2];
++ regs->gprs[3] &mask, regs->gprs[4] &mask,
++ regs->gprs[5] &mask);
+
+ return regs->gprs[2];
}
asmlinkage void do_syscall_trace_exit(struct pt_regs *regs)