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: <yt9dwmecya4g.fsf@linux.ibm.com>
Date: Thu, 30 Jan 2025 09:33:03 +0100
From: Sven Schnelle <svens@...ux.ibm.com>
To: "Dmitry V. Levin" <ldv@...ace.io>
Cc: Oleg Nesterov <oleg@...hat.com>, Alexey Gladkov <legion@...nel.org>,
        Charlie Jenkins <charlie@...osinc.com>,
        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,
        Vineet Gupta <vgupta@...nel.org>,
        Russell
 King <linux@...linux.org.uk>, Will Deacon <will@...nel.org>,
        Guo Ren
 <guoren@...nel.org>, Brian Cain <bcain@...cinc.com>,
        Huacai Chen
 <chenhuacai@...nel.org>, WANG Xuerui <kernel@...0n.name>,
        Thomas
 Bogendoerfer <tsbogend@...ha.franken.de>,
        Dinh Nguyen
 <dinguyen@...nel.org>, Jonas Bonn <jonas@...thpole.se>,
        Stefan
 Kristiansson <stefan.kristiansson@...nalahti.fi>,
        Stafford Horne
 <shorne@...il.com>,
        "James E.J. Bottomley"
 <James.Bottomley@...senPartnership.com>,
        Helge Deller <deller@....de>,
        Madhavan Srinivasan <maddy@...ux.ibm.com>,
        Michael Ellerman
 <mpe@...erman.id.au>,
        Nicholas Piggin <npiggin@...il.com>,
        Christophe
 Leroy <christophe.leroy@...roup.eu>,
        Naveen N Rao <naveen@...nel.org>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt
 <palmer@...belt.com>,
        Albert Ou <aou@...s.berkeley.edu>, Heiko Carstens
 <hca@...ux.ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>,
        Alexander
 Gordeev <agordeev@...ux.ibm.com>,
        Christian Borntraeger
 <borntraeger@...ux.ibm.com>,
        Yoshinori Sato <ysato@...rs.sourceforge.jp>,
        Rich Felker <dalias@...c.org>,
        John Paul Adrian Glaubitz
 <glaubitz@...sik.fu-berlin.de>,
        "David S. Miller" <davem@...emloft.net>,
        Andreas Larsson <andreas@...sler.com>,
        Richard Weinberger
 <richard@....at>,
        Anton Ivanov <anton.ivanov@...bridgegreys.com>,
        Johannes Berg <johannes@...solutions.net>,
        Thomas Gleixner
 <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
        Borislav Petkov
 <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        "H. Peter Anvin" <hpa@...or.com>, Chris Zankel
 <chris@...kel.net>,
        Max Filippov <jcmvbkbc@...il.com>, Arnd Bergmann
 <arnd@...db.de>,
        linux-snps-arc@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-csky@...r.kernel.org,
        linux-hexagon@...r.kernel.org, loongarch@...ts.linux.dev,
        linux-mips@...r.kernel.org, linux-openrisc@...r.kernel.org,
        linux-parisc@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
        linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org,
        linux-sh@...r.kernel.org, sparclinux@...r.kernel.org,
        linux-um@...ts.infradead.org, linux-arch@...r.kernel.org
Subject: Re: [PATCH v3 2/6] syscall.h: add syscall_set_arguments() and
 syscall_set_return_value()

"Dmitry V. Levin" <ldv@...ace.io> writes:

> These functions are going to be needed on all HAVE_ARCH_TRACEHOOK
> architectures to implement PTRACE_SET_SYSCALL_INFO API.
>
> This partially reverts commit 7962c2eddbfe ("arch: remove unused
> function syscall_set_arguments()") by reusing some of old
> syscall_set_arguments() implementations.
>
> Signed-off-by: Dmitry V. Levin <ldv@...ace.io>
> Tested-by: Charlie Jenkins <charlie@...osinc.com>
> Reviewed-by: Charlie Jenkins <charlie@...osinc.com>
> ---
>  arch/arc/include/asm/syscall.h        | 14 +++++++++++
>  arch/arm/include/asm/syscall.h        | 13 ++++++++++
>  arch/arm64/include/asm/syscall.h      | 13 ++++++++++
>  arch/csky/include/asm/syscall.h       | 13 ++++++++++
>  arch/hexagon/include/asm/syscall.h    | 14 +++++++++++
>  arch/loongarch/include/asm/syscall.h  |  8 ++++++
>  arch/mips/include/asm/syscall.h       | 32 ++++++++++++++++++++++++
>  arch/nios2/include/asm/syscall.h      | 11 ++++++++
>  arch/openrisc/include/asm/syscall.h   |  7 ++++++
>  arch/parisc/include/asm/syscall.h     | 12 +++++++++
>  arch/powerpc/include/asm/syscall.h    | 10 ++++++++
>  arch/riscv/include/asm/syscall.h      |  9 +++++++
>  arch/s390/include/asm/syscall.h       | 12 +++++++++
>  arch/sh/include/asm/syscall_32.h      | 12 +++++++++
>  arch/sparc/include/asm/syscall.h      | 10 ++++++++
>  arch/um/include/asm/syscall-generic.h | 14 +++++++++++
>  arch/x86/include/asm/syscall.h        | 36 +++++++++++++++++++++++++++
>  arch/xtensa/include/asm/syscall.h     | 11 ++++++++
>  include/asm-generic/syscall.h         | 16 ++++++++++++
>  19 files changed, 267 insertions(+)
>
> diff --git a/arch/s390/include/asm/syscall.h b/arch/s390/include/asm/syscall.h
> index 27e3d804b311..b3dd883699e7 100644
> --- a/arch/s390/include/asm/syscall.h
> +++ b/arch/s390/include/asm/syscall.h
> @@ -78,6 +78,18 @@ static inline void syscall_get_arguments(struct task_struct *task,
>  	args[0] = regs->orig_gpr2 & mask;
>  }
>  
> +static inline void syscall_set_arguments(struct task_struct *task,
> +					 struct pt_regs *regs,
> +					 const unsigned long *args)
> +{
> +	unsigned int n = 6;
> +
> +	while (n-- > 0)
> +		if (n > 0)
> +			regs->gprs[2 + n] = args[n];
> +	regs->orig_gpr2 = args[0];
> +}

Could that be changed to something like:

for (int n = 1; n < 6; n++)
        regs->gprs[2 + n] = args[n];
regs->orig_gpr2 = args[0];

I think this is way easier to parse.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ