This is a note to let you know that I've just added the patch titled MIPS: scall64-o32: Fix indirect syscall detection to the 3.16-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mips-scall64-o32-fix-indirect-syscall-detection.patch and it can be found in the queue-3.16 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 5245689900804604fdc349c8d9b8985b0e401ae2 Mon Sep 17 00:00:00 2001 From: Markos Chandras <markos.chandras@xxxxxxxxxx> Date: Thu, 24 Jul 2014 12:10:02 +0100 Subject: MIPS: scall64-o32: Fix indirect syscall detection From: Markos Chandras <markos.chandras@xxxxxxxxxx> commit 5245689900804604fdc349c8d9b8985b0e401ae2 upstream. Commit 4c21b8fd8f14 (MIPS: seccomp: Handle indirect system calls (o32)) added indirect syscall detection for O32 processes running on MIPS64 but it did not work as expected. The reason is the the scall64-o32 implementation differs compared to scall32-o32. In the former, the v0 (syscall number) register contains the absolute syscall number (4000 + X) whereas in the latter it contains the relative syscall number (X). Fix the code to avoid doing an extra addition, and load the v0 register directly to the first argument for syscall_trace_enter. Moreover, set the .reorder assembler option in order to have better control on this part of the assembly code. Signed-off-by: Markos Chandras <markos.chandras@xxxxxxxxxx> Patchwork: http://patchwork.linux-mips.org/patch/7481/ Signed-off-by: James Hogan <james.hogan@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/mips/kernel/scall64-o32.S | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S @@ -113,15 +113,19 @@ trace_a_syscall: move s0, t2 # Save syscall pointer move a0, sp /* - * syscall number is in v0 unless we called syscall(__NR_###) + * absolute syscall number is in v0 unless we called syscall(__NR_###) * where the real syscall number is in a0 * note: NR_syscall is the first O32 syscall but the macro is * only defined when compiling with -mabi=32 (CONFIG_32BIT) * therefore __NR_O32_Linux is used (4000) */ - addiu a1, v0, __NR_O32_Linux - bnez v0, 1f /* __NR_syscall at offset 0 */ - lw a1, PT_R4(sp) + .set push + .set reorder + subu t1, v0, __NR_O32_Linux + move a1, v0 + bnez t1, 1f /* __NR_syscall at offset 0 */ + lw a1, PT_R4(sp) /* Arg1 for __NR_syscall case */ + .set pop 1: jal syscall_trace_enter Patches currently in stable-queue which might be from markos.chandras@xxxxxxxxxx are queue-3.16/mips-smp-mt-fix-link-error-when-proc_fs-n.patch queue-3.16/mips-malta-improve-system-memory-detection-for-e-memsize-2g.patch queue-3.16/mips-malta-eva-rename-eva_entry-to-platform_eva_init.patch queue-3.16/mips-syscall-fix-audit-value-for-o32-processes-on-mips64.patch queue-3.16/mips-eva-add-new-eva-header.patch queue-3.16/mips-cps-initialize-eva-before-bringing-up-vpes-from-secondary-cores.patch queue-3.16/mips-scall64-o32-fix-indirect-syscall-detection.patch queue-3.16/mips-octeon-make-get_system_type-thread-safe.patch queue-3.16/mips-gic-prevent-array-overrun.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html