Celeste Liu coelacanthushex@gmail.com writes:
Otherwise when the tracer changes syscall number to -1, the kernel fails to initialize a0 with -ENOSYS and subsequently fails to return the error code of the failed syscall to userspace. For example, it will break strace syscall tampering.
Fixes: 52449c17bdd1 ("riscv: entry: set a0 = -ENOSYS only when syscall != -1") Cc: stable@vger.kernel.org Signed-off-by: Celeste Liu CoelacanthusHex@gmail.com
Reported-by: "Dmitry V. Levin" ldv@strace.io Reviewed-by: Björn Töpel bjorn@rivosinc.com