[PATCH v4 1/2] ptrace: reject out of range error values in PTRACE_SET_SYSCALL_INFO

Oleg Nesterov oleg at redhat.com
Mon Nov 16 14:03:41 UTC 2026


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 at redhat.com>


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



More information about the Strace-devel mailing list