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 v2 09/13] parisc: pass pt_regs to audit_syscall_entry()
Date: Wed, 02 Sep 2026 15:01:29 +0000	[thread overview]
Message-ID: <20260902150130.56B981F00ADB@smtp.kernel.org> (raw)
In-Reply-To: <83d9a03e1fa526aef9f2ecac704c118a156401d7.1788351089.git.rrobaina@redhat.com>

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

New issues:
- [High] Removal of explicit 32-bit masking for compat syscall arguments allows a ptracer to bypass audit filters and leaks upper 32 bits into audit logs.

Pre-existing issues:
- [High] Seccomp evaluates unmasked 64-bit register values for 32-bit compat tasks, allowing bypass of reject filters.
--

commit 78cafbbd76943b4c2f06e1817363e637bd633afe
Author: Ricardo Robaina <rrobaina@redhat.com>

parisc: pass pt_regs to audit_syscall_entry()

This commit changes audit_syscall_entry() to take a pointer to pt_regs
and extract the syscall arguments itself via syscall_get_arguments(). The
individual argument registers are dropped from the call.

> diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c
> index 1d9e210702e1f..948e0cf29ba47 100644
> --- a/arch/parisc/kernel/ptrace.c
> +++ b/arch/parisc/kernel/ptrace.c

[ ... ]

> @@ -359,15 +359,10 @@ long do_syscall_trace_enter(struct pt_regs *regs)
>  
>  #ifdef CONFIG_64BIT
>  	if (!is_compat_task())
> -		audit_syscall_entry(regs->gr[20], regs->gr[26], regs->gr[25],
> -				    regs->gr[24], regs->gr[23]);
> +		audit_syscall_entry(regs->gr[20], regs);
>  	else
>  #endif
> -		audit_syscall_entry(regs->gr[20] & 0xffffffff,
> -			regs->gr[26] & 0xffffffff,
> -			regs->gr[25] & 0xffffffff,
> -			regs->gr[24] & 0xffffffff,
> -			regs->gr[23] & 0xffffffff);
> +		audit_syscall_entry(regs->gr[20] & 0xffffffff, regs);

[Severity: High]
Does removing the explicit 32-bit masking for compat syscall arguments allow
a ptracer to bypass audit filters?

Since audit_syscall_entry() now uses syscall_get_arguments() internally to
extract the registers, and syscall_get_arguments() does not truncate the
arguments to 32 bits on PARISC:

arch/parisc/include/asm/syscall.h:syscall_get_arguments() {
	args[5] = regs->gr[21];
	args[4] = regs->gr[22];
	args[3] = regs->gr[23];
	args[2] = regs->gr[24];
	args[1] = regs->gr[25];
	args[0] = regs->gr[26];
}

An attacker in a 32-bit compat task could manipulate the upper 32 bits of
syscall argument registers via ptrace. Audit would evaluate the unmasked
64-bit values, while the syscall wrapper would truncate them to 32 bits,
potentially leading to an evasion of security audit logging.

[Severity: High]
This is a pre-existing issue, but does Seccomp also evaluate unmasked 64-bit
register values for 32-bit compat tasks on PARISC?

Seccomp relies on syscall_get_arguments() in populate_seccomp_data():

kernel/seccomp.c:populate_seccomp_data() {
	...
	syscall_get_arguments(task, regs, args);
	sd->args[0] = args[0];
	sd->args[1] = args[1];
	...
}

Because syscall_get_arguments() does not mask the upper 32 bits for compat
tasks, could an attacker bypass Seccomp reject filters by injecting 64-bit
values with garbage in the upper 32 bits before Seccomp evaluates them?

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

  reply	other threads:[~2026-09-02 15:01 UTC|newest]

Thread overview: 30+ 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-04 17:21   ` Magnus Lindholm
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
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 [this message]
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=20260902150130.56B981F00ADB@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.