Re: [PATCH v2 6/7] ptrace: introduce PTRACE_SET_SYSCALL_INFO request

From
Oleg Nesterov <oleg@redhat.com>
Date
2025-01-17 14:46:36
Also in
lkml
Reply to
Dmitry V. Levin, 2025-01-16
On 01/16, Dmitry V. Levin wrote:
The idea is to use "op" to specify the operation, and "flags" to specify
future extensions to the operation.
OK,
That is, the zero check implied by copy_struct_from_user() is not really
needed here since the compatibility is tracked by "op" and "flags":
OK, but then why this patch uses copy_struct_from_user() ?

Why can't we simply do

	if (user_size != PTRACE_SYSCALL_INFO_SIZE_VER0)
		return -EINVAL;

	if (copy_from_user(..., user_size))
		return EFAULT;

now, until we add the extensions ?

Oleg.
Thread (19 messages) 19 messages, 4 authors, last reply 2025-01-20
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