diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2022-08-08 18:08:48 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-08-25 12:09:30 +0300 |
commit | bcb306aadd9fde6fc61126eceea1678f30ec68ec (patch) | |
tree | f5897da58ac89f7ef54b5e9deef8ed3d3f5bdd6b | |
parent | 60cd5c1a0667294acac87728086f0b574f3ae5cc (diff) | |
download | linux-bcb306aadd9fde6fc61126eceea1678f30ec68ec.tar.xz |
nios2: fix syscall restart checks
commit 2d631bd58fe0ea3e3350212e23c9aba1fb606514 upstream.
sys_foo() returns -512 (aka -ERESTARTSYS) => do_signal() sees
512 in r2 and 1 in r1.
sys_foo() returns 512 => do_signal() sees 512 in r2 and 0 in r1.
The former is restart-worthy; the latter obviously isn't.
Fixes: b53e906d255d ("nios2: Signal handling support")
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>
-rw-r--r-- | arch/nios2/kernel/signal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/nios2/kernel/signal.c b/arch/nios2/kernel/signal.c index 20662b0f6c9e..34588df93e35 100644 --- a/arch/nios2/kernel/signal.c +++ b/arch/nios2/kernel/signal.c @@ -240,7 +240,7 @@ static int do_signal(struct pt_regs *regs) /* * If we were from a system call, check for system call restarting... */ - if (regs->orig_r2 >= 0) { + if (regs->orig_r2 >= 0 && regs->r1) { continue_addr = regs->ea; restart_addr = continue_addr - 4; retval = regs->r2; |