MIPS: Fix seccomp syscall argument for MIPS64
authorMarkos Chandras <markos.chandras@imgtec.com>
Thu, 13 Aug 2015 07:47:59 +0000 (08:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 16:07:45 +0000 (09:07 -0700)
commit6829ed43ba4fb8b4957bc6a6915e8372ad848d97
tree60e1689b3e300810f10c33b184b24f32b2cfa9c4
parentfd1090c256f53c12d3840056a15112264ee26c0a
MIPS: Fix seccomp syscall argument for MIPS64

commit 9f161439e4104b641a7bfb9b89581d801159fec8 upstream.

Commit 4c21b8fd8f14 ("MIPS: seccomp: Handle indirect system calls (o32)")
fixed indirect system calls on O32 but it also introduced a bug for MIPS64
where it erroneously modified the v0 (syscall) register with the assumption
that the sycall offset hasn't been taken into consideration. This breaks
seccomp on MIPS64 n64 and n32 ABIs. We fix this by replacing the addition
with a move instruction.

Fixes: 4c21b8fd8f14 ("MIPS: seccomp: Handle indirect system calls (o32)")
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/10951/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/kernel/scall64-64.S
arch/mips/kernel/scall64-n32.S