From: Linus Torvalds Date: Sat, 30 Jul 2016 00:54:17 +0000 (-0700) Subject: Merge branch 'stable-4.8' of git://git.infradead.org/users/pcmoore/audit X-Git-Tag: v4.8-rc1~94 X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fcifs-2.6.git;a=commitdiff_plain;h=797cee982eef9195736afc5e7f3b8f613c41d19a Merge branch 'stable-4.8' of git://git.infradead.org/users/pcmoore/audit Pull audit updates from Paul Moore: "Six audit patches for 4.8. There are a couple of style and minor whitespace tweaks for the logs, as well as a minor fixup to catch errors on user filter rules, however the major improvements are a fix to the s390 syscall argument masking code (reviewed by the nice s390 folks), some consolidation around the exclude filtering (less code, always a win), and a double-fetch fix for recording the execve arguments" * 'stable-4.8' of git://git.infradead.org/users/pcmoore/audit: audit: fix a double fetch in audit_log_single_execve_arg() audit: fix whitespace in CWD record audit: add fields to exclude filter by reusing user filter s390: ensure that syscall arguments are properly masked on s390 audit: fix some horrible switch statement style crimes audit: fixup: log on errors from filter user rules --- 797cee982eef9195736afc5e7f3b8f613c41d19a diff --cc arch/s390/kernel/ptrace.c index cea17010448f,defc0dca4510..9336e824e2db --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c @@@ -821,6 -821,16 +821,8 @@@ long compat_arch_ptrace(struct task_str 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]. @@@ -846,11 -850,14 +848,14 @@@ 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)