From: Michael Ellerman Date: Thu, 23 Jul 2015 10:21:06 +0000 (+1000) Subject: powerpc: Use orig_gpr3 in syscall_get_arguments() X-Git-Tag: omap-for-v4.3/fixes-rc1~100^2~79 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cb9839b73e7f2b006a1cc9452c30f15ff8b1748;p=pandora-kernel.git powerpc: Use orig_gpr3 in syscall_get_arguments() Currently syscall_get_arguments() is used by syscall tracepoints, and collect_syscall() which is used in some debugging as well as /proc/pid/syscall. The current implementation just copies regs->gpr[3 .. 5] out, which is fine for all the current use cases. When we enable seccomp filter, that will also start using syscall_get_arguments(). However for seccomp filter we want to use r3 as the return value of the syscall, and orig_gpr3 as the first parameter. This will allow seccomp to modify the return value in r3. To support this we need to modify syscall_get_arguments() to return orig_gpr3 instead of r3. This is safe for all uses because orig_gpr3 always contains the r3 value that was passed to the syscall. We store it in the syscall entry path and never modify it. Update syscall_set_arguments() while we're here, even though it's never used. Signed-off-by: Michael Ellerman Reviewed-by: Kees Cook --- Reading git-diff-tree failed