# Re: \[PATCH v4 1/2\] ptrace: reject out of range error values in PTRACE\_SET\_SYSCALL\_INFO

- From: Oleg Nesterov \<oleg@redhat.com\>
- Date: 2026-11-16 14:03:54 
- List: linux-api
- Page: https://ratatoskr.run/linux-api/2026/11/17945341
- Thread: https://ratatoskr.run/linux-api/2026/11/17945156/t.md

```text
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@redhat.com>


(I think you can even drop the comment, IS_ERR_VALUE() is self-explanatory)

```
