Skip to contentSkip to conversation

Patch "MIPS: Fix seccomp syscall argument for MIPS64" has been added to the 4.1-stable tree

PATCH [email protected] 1 participant 1 message Sep 11, 2015

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

MIPS: Fix seccomp syscall argument for MIPS64

to the 4.1-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-fix-seccomp-syscall-argument-for-mips64.patch
and it can be found in the queue-4.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 9f161439e4104b641a7bfb9b89581d801159fec8 Mon Sep 17 00:00:00 2001

From: Markos Chandras <[email protected]>
Date: Thu, 13 Aug 2015 08:47:59 +0100
Subject: MIPS: Fix seccomp syscall argument for MIPS64

From: Markos Chandras <[email protected]>

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)")

Patchwork: https://patchwork.linux-mips.org/patch/10951/

---
 arch/mips/kernel/scall64-64.S  |    2 +-
 arch/mips/kernel/scall64-n32.S |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/kernel/scall64-64.S +1 -1
@@ -80,7 +80,7 @@ syscall_trace_entry:
 	SAVE_STATIC
 	move	s0, t2
 	move	a0, sp
-	daddiu	a1, v0, __NR_64_Linux
+	move	a1, v0
 	jal	syscall_trace_enter
 
 	bltz	v0, 2f			# seccomp failed? Skip syscall
arch/mips/kernel/scall64-n32.S +1 -1
@@ -72,7 +72,7 @@ n32_syscall_trace_entry:
 	SAVE_STATIC
 	move	s0, t2
 	move	a0, sp
-	daddiu	a1, v0, __NR_N32_Linux
+	move	a1, v0
 	jal	syscall_trace_enter
 
 	bltz	v0, 2f			# seccomp failed? Skip syscall

Patches currently in stable-queue which might be from [email protected] are

queue-4.1/mips-fix-seccomp-syscall-argument-for-mips64.patch