Skip to content

Commit 0ebfd31

Browse files
heicarstMartin Schwidefsky
authored andcommitted
s390/compat,signal: fix return value of copy_siginfo_(to|from)_user32()
The return value of copy_siginfo_(to|from)_user32() gets passed to user space, however we do not convert a positive return value from copy_(to|from)_user to -EFAULT. Therefore these functions (and the calling system calls) my incorrectly return a positive number (bytes not copied) instead of -EFAULT. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 18d6624 commit 0ebfd31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/s390/kernel/compat_signal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
9999
break;
100100
}
101101
}
102-
return err;
102+
return err ? -EFAULT : 0;
103103
}
104104

105105
int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
@@ -148,7 +148,7 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
148148
break;
149149
}
150150
}
151-
return err;
151+
return err ? -EFAULT : 0;
152152
}
153153

154154
static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs)

0 commit comments

Comments
 (0)