Celeste Liu 6111939463
riscv: entry: always initialize regs->a0 to -ENOSYS
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")
Reported-by: "Dmitry V. Levin" <ldv@strace.io>
Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
Cc: stable@vger.kernel.org
Signed-off-by: Celeste Liu <CoelacanthusHex@gmail.com>
Link: https://lore.kernel.org/r/20240627142338.5114-2-CoelacanthusHex@gmail.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2024-08-14 13:12:22 -07:00
..
2024-07-10 14:23:38 +02:00
2024-08-02 13:46:43 -07:00
2024-07-23 14:32:21 -07:00
2024-07-23 14:32:21 -07:00
2024-07-27 12:46:16 -07:00
2024-07-31 16:30:20 +02:00
2024-07-23 11:57:52 -07:00
2024-07-25 10:42:22 -07:00
2024-08-04 08:57:08 -07:00