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: <256357dc-2f29-4af6-8efc-5222170e5e49@arm.com>
Date: Tue, 18 Nov 2025 18:12:51 +0100
From: Kevin Brodsky <kevin.brodsky@....com>
To: Jinjie Ruan <ruanjinjie@...wei.com>, catalin.marinas@....com,
 will@...nel.org, oleg@...hat.com, tglx@...utronix.de, peterz@...radead.org,
 luto@...nel.org, shuah@...nel.org, kees@...nel.org, wad@...omium.org,
 akpm@...ux-foundation.org, ldv@...ace.io, macro@...am.me.uk, deller@....de,
 mark.rutland@....com, song@...nel.org, mbenes@...e.cz, ryan.roberts@....com,
 ada.coupriediaz@....com, anshuman.khandual@....com, broonie@...nel.org,
 pengcan@...inos.cn, dvyukov@...gle.com, kmal@...k.li, lihongbo22@...wei.com,
 linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
 linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v7 07/11] arm64/ptrace: Use syscall_get_arguments()
 heleper

In subject: s/heleper/helper/

On 17/11/2025 14:30, Jinjie Ruan wrote:
> The generic entry check audit context first and use
> syscall_get_arguments() helper.
>
> In order to switch to the generic entry for arm64,
>
> - Also use the helper.
>
> - Extract the syscall_enter_audit() helper to make it clear.
>
> - Check audit context for syscall_enter_audit(), which only adds
>   one additional check without any other differences as
>   audit_syscall_entry() check it first otherwise do nothing.

Presumably this is to avoid an unnecessary memcpy(). Overall these
changes make syscall_enter_audit() exactly equivalent to the generic
one, would be good to spell it out.

> No functional changes.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
> ---
>  arch/arm64/kernel/ptrace.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
> index 9af3046a2ce9..9455ccf1ecc1 100644
> --- a/arch/arm64/kernel/ptrace.c
> +++ b/arch/arm64/kernel/ptrace.c
> @@ -2376,6 +2376,17 @@ static void report_syscall_exit(struct pt_regs *regs)
>  	}
>  }
>  
> +static inline void syscall_enter_audit(struct pt_regs *regs, long syscall)
> +{
> +	if (unlikely(audit_context())) {
> +		unsigned long args[6];
> +
> +		syscall_get_arguments(current, regs, args);
> +		audit_syscall_entry(syscall, args[0], args[1], args[2], args[3]);
> +	}
> +

Nit: empty line.

- Kevin

> +}
> +
>  int syscall_trace_enter(struct pt_regs *regs, long syscall, unsigned long flags)
>  {
>  	int ret;
> @@ -2406,8 +2417,7 @@ int syscall_trace_enter(struct pt_regs *regs, long syscall, unsigned long flags)
>  		 syscall = syscall_get_nr(current, regs);
>  	}
>  
> -	audit_syscall_entry(syscall, regs->orig_x0, regs->regs[1],
> -			    regs->regs[2], regs->regs[3]);
> +	syscall_enter_audit(regs, syscall);
>  
>  	return regs->syscallno;
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ