[PATCH] riscv: entry: always initialize regs->a0 to -ENOSYS

Björn Töpel bjorn at kernel.org
Thu Jun 27 08:48:55 PDT 2024


On Thu, 27 Jun 2024 at 16:29, Celeste Liu <coelacanthushex at gmail.com> wrote:
>
> On 2024-06-27 22:08, Björn Töpel wrote:
>
> > Celeste Liu <coelacanthushex at 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 at vger.kernel.org
> >> Signed-off-by: Celeste Liu <CoelacanthusHex at gmail.com>
> >
> > Reported-by: "Dmitry V. Levin" <ldv at strace.io>
> > Reviewed-by: Björn Töpel <bjorn at rivosinc.com>
>
> Patch v2 has been sent.

For future patches; You don't need to respin a patch to add tags. The
tooling will pick up the tags automatically.



More information about the linux-riscv mailing list