[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250109100943.GA26424@redhat.com>
Date: Thu, 9 Jan 2025 11:09:44 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: "Dmitry V. Levin" <ldv@...ace.io>
Cc: Eugene Syromyatnikov <evgsyr@...il.com>,
Mike Frysinger <vapier@...too.org>,
Renzo Davoli <renzo@...unibo.it>,
Davide Berardi <berardi.dav@...il.com>,
strace-devel@...ts.strace.io, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/6] ptrace_get_syscall_info: factor out
ptrace_get_syscall_info_op
On 01/08, Dmitry V. Levin wrote:
>
> +static int
> +ptrace_get_syscall_info(struct task_struct *child, unsigned long user_size,
> + void __user *datavp)
> +{
> + struct pt_regs *regs = task_pt_regs(child);
> + struct ptrace_syscall_info info = {
> + .op = ptrace_get_syscall_info_op(child),
> + .arch = syscall_get_arch(child),
> + .instruction_pointer = instruction_pointer(regs),
> + .stack_pointer = user_stack_pointer(regs),
> + };
> + unsigned long actual_size = offsetof(struct ptrace_syscall_info, entry);
> + unsigned long write_size;
> +
> + switch (info.op) {
> + case PTRACE_SYSCALL_INFO_ENTRY:
> + actual_size = ptrace_get_syscall_info_entry(child, regs, &info);
> + break;
> + case PTRACE_SYSCALL_INFO_EXIT:
> + actual_size = ptrace_get_syscall_info_exit(child, regs, &info);
> + break;
> + case PTRACE_SYSCALL_INFO_SECCOMP:
> + actual_size = ptrace_get_syscall_info_seccomp(child, regs, &info);
> break;
OK... but unless I misread this patch, all 3 ptrace_get_syscall_info_xxx()
helpers will do the pointless info->op = PTRACE_SYSCALL_INFO_XXX ?
Oleg.
Powered by blists - more mailing lists