All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ricardo Robaina" <rrobaina@redhat.com>
Cc: bpf@vger.kernel.org, audit@vger.kernel.org
Subject: Re: [PATCH 11/13] sparc64: pass all six syscall args to audit_syscall_entry()
Date: Thu, 13 Aug 2026 17:26:45 +0000	[thread overview]
Message-ID: <20260813172646.1476F1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <fc2810a850a8bf343b7ad7ae9caf3da57e1f41ec.1786626275.git.rrobaina@redhat.com>

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

Pre-existing issues:
- [High] 32-bit compat syscall arguments are not zero-extended before being passed to audit_syscall_entry(), leading to a high-severity audit evasion vulnerability for socketcall multiplexed syscalls.
--

--- Patch [11]: [PATCH 11/13] sparc64: pass all six syscall args to audit_syscall_entry() ---
commit 5c60aff4dd1af29adf66c85f200b0a80fe2238fb
Author: Ricardo Robaina <rrobaina@redhat.com>

sparc64: pass all six syscall args to audit_syscall_entry()

This commit updates syscall_trace_enter() to forward the 5th and 6th syscall
arguments (UREG_I4, UREG_I5) to audit_syscall_entry(). This change ensures
all six arguments are passed, aligning with the audit core's expectations.

> diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c
> index 9fc67fa9336fe..d0ad3200d789c 100644
> --- a/arch/sparc/kernel/ptrace_64.c
> +++ b/arch/sparc/kernel/ptrace_64.c
> @@ -1100,7 +1100,8 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs)
>  
>  	audit_syscall_entry(regs->u_regs[UREG_G1], regs->u_regs[UREG_I0],
>  			    regs->u_regs[UREG_I1], regs->u_regs[UREG_I2],
> -			    regs->u_regs[UREG_I3]);
> +			    regs->u_regs[UREG_I3], regs->u_regs[UREG_I4],
> +			    regs->u_regs[UREG_I5]);

[Severity: High]
This isn't a bug introduced by this patch, but is it possible for a 32-bit
compat process to evade audit rules because these arguments are not
zero-extended?

For a 32-bit process executing a multiplexed system call like socketcall,
an attacker could intentionally leave non-zero garbage in the upper 32 bits of
the registers. 

Because syscall_trace_enter() passes the raw 64-bit values directly from
regs->u_regs without zero-extending them, the audit subsystem stores the full
64-bit value. When the audit core later evaluates rules (e.g., checking
ctx->argv[0] == SYS_BIND), the comparison fails due to the upper 32-bit
garbage, bypassing the rule.

Since the SPARC64 assembly later zero-extends the arguments before invoking the
actual compat syscall handler, the syscall succeeds without being properly
audited.

Could we zero-extend these register values for 32-bit compat tasks before
passing them to audit_syscall_entry() to prevent this bypass?

>  
>  	return ret;
>  }

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

  reply	other threads:[~2026-08-13 17:26 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 17:02 [PATCH 00/13] audit: log all six syscall arguments in the SYSCALL record Ricardo Robaina
2026-08-13 17:02 ` [PATCH 01/13] " Ricardo Robaina
2026-08-13 17:20   ` sashiko-bot
2026-08-13 17:02 ` [PATCH 02/13] alpha: pass all six syscall args to audit_syscall_entry() Ricardo Robaina
2026-08-13 17:18   ` sashiko-bot
2026-08-13 17:02 ` [PATCH 03/13] arm: " Ricardo Robaina
2026-08-13 17:20   ` sashiko-bot
2026-08-13 17:02 ` [PATCH 04/13] arm64: " Ricardo Robaina
2026-08-13 17:17   ` sashiko-bot
2026-08-13 17:02 ` [PATCH 05/13] csky: " Ricardo Robaina
2026-08-13 17:16   ` sashiko-bot
2026-08-13 17:02 ` [PATCH 06/13] microblaze: " Ricardo Robaina
2026-08-13 17:15   ` sashiko-bot
2026-08-13 17:02 ` [PATCH 07/13] mips: " Ricardo Robaina
2026-08-13 17:15   ` sashiko-bot
2026-08-13 17:02 ` [PATCH 08/13] openrisc: " Ricardo Robaina
2026-08-13 17:20   ` sashiko-bot
2026-08-13 17:02 ` [PATCH 09/13] parisc: " Ricardo Robaina
2026-08-13 17:13   ` sashiko-bot
2026-08-13 17:03 ` [PATCH 10/13] sh: " Ricardo Robaina
2026-08-13 17:24   ` sashiko-bot
2026-08-13 17:03 ` [PATCH 11/13] sparc64: " Ricardo Robaina
2026-08-13 17:26   ` sashiko-bot [this message]
2026-08-13 17:03 ` [PATCH 12/13] um: " Ricardo Robaina
2026-08-13 17:19   ` sashiko-bot
2026-08-13 17:03 ` [PATCH 13/13] xtensa: " Ricardo Robaina
2026-08-13 17:23   ` 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=20260813172646.1476F1F00A3A@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.