lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250109102755.GA15384@strace.io>
Date: Thu, 9 Jan 2025 12:27:55 +0200
From: "Dmitry V. Levin" <ldv@...ace.io>
To: Oleg Nesterov <oleg@...hat.com>
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 Thu, Jan 09, 2025 at 11:09:44AM +0100, Oleg Nesterov wrote:
> 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 ?

Thanks, your analysis is correct, with this change those assignments
become redundant, I'll remove them in the next iteration of this patch.


-- 
ldv

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ