Skip to content
Commit 5af2ed36 authored by James Cowgill's avatar James Cowgill Committed by Ralf Baechle
Browse files

MIPS: Remove pt_regs adjustments in indirect syscall handler



If a restartable syscall is called using the indirect o32 syscall
handler - eg: syscall(__NR_waitid, ...), then it is possible for the
incorrect arguments to be passed to the syscall after it has been
restarted. This is because the syscall handler tries to shift all the
registers down one place in pt_regs so that when the syscall is restarted,
the "real" syscall is called instead. Unfortunately it only shifts the
arguments passed in registers, not the arguments on the user stack. This
causes the 4th argument to be duplicated when the syscall is restarted.

Fix by removing all the pt_regs shifting so that the indirect syscall
handler is called again when the syscall is restarted. The comment "some
syscalls like execve get their arguments from struct pt_regs" is long
out of date so this should now be safe.

Signed-off-by: default avatarJames Cowgill <James.Cowgill@imgtec.com>
Reviewed-by: default avatarJames Hogan <james.hogan@imgtec.com>
Tested-by: default avatarJames Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15856/
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 3d729dea
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment