[PATCH] m68k: syscall: fix syscall_get_arguments() argument mapping

Yiqi Sun <[email protected]>
Newsgroups org.kernel.vger.linux-m68k,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On m68k, syscall_get_arguments() currently returns orig_d0 as args[0],
followed by d1-d5 as args[1..5].

However, syscall arguments are passed in d1-d5 and a0, so args[0]
should reflect d1, and the full argument set should include a0.

Fix the mapping by copying all six arguments from the saved register
block starting at d1.

Fixes: 6baaade15594 ("m68k: Add kernel seccomp support")
Signed-off-by: Yiqi Sun <[email protected]>
---
 arch/m68k/include/asm/syscall.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/m68k/include/asm/syscall.h b/arch/m68k/include/asm/syscall.h
index bf84b160c2eb..2e268eeedad3 100644
--- a/arch/m68k/include/asm/syscall.h
+++ b/arch/m68k/include/asm/syscall.h
@@ -52,10 +52,7 @@ static inline void syscall_get_arguments(struct task_struct *task,
 					 struct pt_regs *regs,
 					 unsigned long *args)
 {
-	args[0] = regs->orig_d0;
-	args++;
-
-	memcpy(args, &regs->d1, 5 * sizeof(args[0]));
+	memcpy(args, &regs->d1, 6 * sizeof(args[0]));
 }
 
 static inline void syscall_set_arguments(struct task_struct *task,
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.