BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ricardo Robaina" <rrobaina@redhat.com>
Cc: audit@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH v2 03/13] arm: pass pt_regs to audit_syscall_entry()
Date: Wed, 02 Sep 2026 14:58:32 +0000	[thread overview]
Message-ID: <20260902145833.47A671F000E9@smtp.kernel.org> (raw)
In-Reply-To: <cae4a0a79178cf7d1b661c10ee2fa038fc6ebdea.1788351089.git.rrobaina@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The transition to using `syscall_get_arguments()` for audit logging causes the first syscall argument to be read from `regs->ARM_ORIG_r0` instead of `regs->ARM_r0`. This allows tracers to bypass audit logging by spoofing arguments, as the audit subsystem logs the unmodified argument while the kernel executes the modified one.
--

commit 2a794057248ff5b9ad0444e2a1b1392a156db536
Author: Ricardo Robaina <rrobaina@redhat.com>

arm: pass pt_regs to audit_syscall_entry()

This commit updates syscall_trace_enter() on ARM to pass the pt_regs
structure directly to audit_syscall_entry() instead of individual arguments.
The audit logging subsystem now extracts the arguments itself via
syscall_get_arguments().

> diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
> index ed7a2a87a6707..e103ec2661cd4 100644
> --- a/arch/arm/kernel/ptrace.c
> +++ b/arch/arm/kernel/ptrace.c
> @@ -868,8 +868,7 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs)
>  	if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
>  		trace_sys_enter(regs, scno);
>  
> -	audit_syscall_entry(scno, regs->ARM_r0, regs->ARM_r1, regs->ARM_r2,
> -			    regs->ARM_r3);
> +	audit_syscall_entry(scno, regs);

[Severity: High]
Does this change allow tracers to bypass audit logging by spoofing syscall
arguments?

By delegating argument extraction to the helper, the first syscall argument
is now extracted via syscall_get_arguments(), which reads from
regs->ARM_ORIG_r0. The previous code directly passed regs->ARM_r0.

If a user-space process intercepts the syscall at PTRACE_SYSCALL_ENTER and
modifies the first argument via PTRACE_POKEUSR to write to regs->ARM_r0,
the audit subsystem will log the unmodified argument from regs->ARM_ORIG_r0.
However, the syscall dispatcher will subsequently reload r0 from
regs->ARM_r0, causing the kernel to execute the modified argument while the
benign one is logged.

Can we ensure the audit subsystem logs the active argument that will
actually be executed?

>  
>  	return scno;
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1788351089.git.rrobaina@redhat.com?part=3

  reply	other threads:[~2026-09-02 14:58 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 14:43 [PATCH v2 00/13] audit: log all six syscall arguments in the SYSCALL record Ricardo Robaina
2026-09-02 14:43 ` [PATCH v2 01/13] " Ricardo Robaina
2026-09-02 14:55   ` sashiko-bot
2026-09-03  8:21   ` Will Deacon
2026-09-02 14:43 ` [PATCH v2 02/13] alpha: pass pt_regs to audit_syscall_entry() Ricardo Robaina
2026-09-02 14:55   ` sashiko-bot
2026-09-02 14:43 ` [PATCH v2 03/13] arm: " Ricardo Robaina
2026-09-02 14:58   ` sashiko-bot [this message]
2026-09-02 14:43 ` [PATCH v2 04/13] arm64: " Ricardo Robaina
2026-09-02 15:04   ` sashiko-bot
2026-09-03  8:22   ` Will Deacon
2026-09-02 14:43 ` [PATCH v2 05/13] csky: " Ricardo Robaina
2026-09-02 14:58   ` sashiko-bot
2026-09-02 14:43 ` [PATCH v2 06/13] microblaze: " Ricardo Robaina
2026-09-02 14:56   ` sashiko-bot
2026-09-02 14:43 ` [PATCH v2 07/13] mips: " Ricardo Robaina
2026-09-02 14:57   ` sashiko-bot
2026-09-02 14:43 ` [PATCH v2 08/13] openrisc: " Ricardo Robaina
2026-09-02 15:07   ` sashiko-bot
2026-09-02 14:43 ` [PATCH v2 09/13] parisc: " Ricardo Robaina
2026-09-02 15:01   ` sashiko-bot
2026-09-02 14:43 ` [PATCH v2 10/13] sh: " Ricardo Robaina
2026-09-02 14:58   ` sashiko-bot
2026-09-02 14:43 ` [PATCH v2 11/13] sparc64: " Ricardo Robaina
2026-09-02 15:01   ` sashiko-bot
2026-09-02 14:43 ` [PATCH v2 12/13] um: " Ricardo Robaina
2026-09-02 15:07   ` sashiko-bot
2026-09-02 14:43 ` [PATCH v2 13/13] xtensa: " Ricardo Robaina
2026-09-02 15:02   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260902145833.47A671F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=audit@vger.kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=rrobaina@redhat.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox