Skip to content
Commit 828db212 authored by James Hogan's avatar James Hogan Committed by Ralf Baechle
Browse files

MIPS: Traced negative syscalls should return -ENOSYS

If a negative system call number is used when system call tracing is
enabled, syscall_trace_enter() will return that negative system call
number without having written the return value and error flag into the
pt_regs.

The caller then treats it as a cancelled system call and assumes that
the return value and error flag are already written, leaving the
negative system call number in the return register ($v0), and the 4th
system call argument in the error register ($a3).

Add a special case to detect this at the end of syscall_trace_enter(),
to set the return value to error -ENOSYS when this happens.

Fixes: d218af78

 ("MIPS: scall: Always run the seccomp syscall filters")
Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/16653/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent becddba9
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