]> git.baikalelectronics.ru Git - kernel.git/commit
nios2: add force_successful_syscall_return()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 8 Aug 2022 15:09:45 +0000 (16:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:18:28 +0000 (11:18 +0200)
commit911bce23e3dc5d4a451ee6a60b1554576d39c96c
treef928fb4447498ce371ada7e80b110570e484741e
parentc670be60fe8794ee8c803898982d9978a1e44a62
nios2: add force_successful_syscall_return()

commit 4ffc5e34603b2ad6b6780a404599e837866ad526 upstream.

If we use the ancient SysV syscall ABI, we'd better have tell the
kernel how to claim that a negative return value is a success.
Use ->orig_r2 for that - it's inaccessible via ptrace, so it's
a fair game for changes and it's normally[*] non-negative on return
from syscall.  Set to -1; syscall is not going to be restart-worthy
by definition, so we won't interfere with that use either.

[*] the only exception is rt_sigreturn(), where we skip the entire
messing with r1/r2 anyway.

Fixes: 94128c9936ba ("nios2: Exception handling")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/nios2/include/asm/ptrace.h
arch/nios2/kernel/entry.S