diff options
author | Celeste Liu <[email protected]> | 2024-06-27 22:23:39 +0800 |
---|---|---|
committer | Palmer Dabbelt <[email protected]> | 2024-08-14 13:12:22 -0700 |
commit | 61119394631f219e23ce98bcc3eb993a64a8ea64 (patch) | |
tree | b0b47a1e641edcb5eff2b050813872501dc5b8c9 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | ee9a68394b4bea8b9044ec4bfdbaacf45297ecef (diff) |
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" <[email protected]>
Reviewed-by: Björn Töpel <[email protected]>
Cc: [email protected]
Signed-off-by: Celeste Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Palmer Dabbelt <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions