Re: [PATCH v4 1/2] ptrace: reject out of range error values in PTRACE_SET_SYSCALL_INFO
From: Oleg Nesterov
Date: Mon Nov 16 2026 - 09:04:06 EST
On 11/16, Renzo Davoli wrote:
>
> --- 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@xxxxxxxxxx>
(I think you can even drop the comment, IS_ERR_VALUE() is self-explanatory)