On 11/16, Renzo Davoli wrote:
quoted hunk ↗ jump to hunk
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -1111,6 +1111,10 @@ ptrace_set_syscall_info_exit(struct task_struct *child, struct pt_regs *regs,
if (rval != info->exit.rval)
return -ERANGE;
+ /* An error must be a negative errno value. */
+ if (info->exit.is_error && !IS_ERR_VALUE(rval))
+ return -ERANGE;
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
(I think you can even drop the comment, IS_ERR_VALUE() is self-explanatory)