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
Also in
linux-kselftest, lkml
Reply to
Renzo Davoli, 2026-11-16
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)
Thread (4 messages) 4 messages, 2 authors, last reply 6h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help