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 04/13] arm64: pass pt_regs to audit_syscall_entry()
Date: Wed, 02 Sep 2026 15:04:07 +0000	[thread overview]
Message-ID: <20260902150407.A91791F00A3E@smtp.kernel.org> (raw)
In-Reply-To: <b4ab47d2551d090520b4fa81a884b5988b9655c7.1788351089.git.rrobaina@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Syscall argument filtering truncates 64-bit arguments to 32 bits, allowing audit filter bypass.
--

commit 32fa904a92560e78e9593b4944ee636ddfb88ea9
Author: Ricardo Robaina <rrobaina@redhat.com>

arm64: pass pt_regs to audit_syscall_entry()

This commit updates arm64 to pass a pointer to pt_regs directly to
audit_syscall_entry(), allowing the audit subsystem to extract the
syscall arguments itself.

> diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
> --- a/arch/arm64/kernel/ptrace.c
> +++ b/arch/arm64/kernel/ptrace.c
[ ... ]
> @@ -2476,8 +2476,7 @@ int syscall_trace_enter(struct pt_regs *regs)
>  	if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
>  		trace_sys_enter(regs, regs->syscallno);
>  
> -	audit_syscall_entry(regs->syscallno, regs->orig_x0, regs->regs[1],
> -			    regs->regs[2], regs->regs[3]);
> +	audit_syscall_entry(regs->syscallno, regs);

[Severity: High]
This is a pre-existing issue, but does the underlying audit framework truncate
these 64-bit syscall arguments to 32 bits during filtering?

When the extracted 64-bit arguments are later evaluated in
kernel/auditsc.c:audit_filter_rules(), they are passed to
audit_comparator():

    result = audit_comparator(ctx->argv[f->type-AUDIT_ARG0], f->op, f->val);

However, looking at kernel/auditfilter.c, the signature of audit_comparator()
implicitly truncates the 64-bit argument to a u32:

    int audit_comparator(u32 left, u32 op, u32 right)

Can this allow an unprivileged user-space process to bypass audit filtering
rules (such as != or <) targeting 64-bit syscall arguments? By crafting
64-bit values whose lower 32 bits evade the 32-bit rule comparison, the full
64-bit value processed by the kernel could still execute normally while
evading audit logging.

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

  reply	other threads:[~2026-09-02 15:04 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
2026-09-02 14:43 ` [PATCH v2 04/13] arm64: " Ricardo Robaina
2026-09-02 15:04   ` sashiko-bot [this message]
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=20260902150407.A91791F00A3E@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