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 08/13] openrisc: pass all six syscall args to audit_syscall_entry()
Date: Thu, 13 Aug 2026 17:20:42 +0000	[thread overview]
Message-ID: <20260813172043.37A671F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <1616198d0cfa9434b36fc1ac6055064ae8c08057.1786626275.git.rrobaina@redhat.com>

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

New issues:
- [Low] The patch series breaks git bisectability by changing a core function signature before updating all architecture callers.

Pre-existing issues:
- [High] The return value of `do_syscall_trace_enter()` is ignored, breaking ptrace syscall abortion (e.g., PTRACE_SYSEMU).
--

--- Patch [8]: [PATCH 08/13] openrisc: pass all six syscall args to audit_syscall_entry() ---
commit 9ca4bd79e1e00767e994486accfe2484de6f3a04
Author: Ricardo Robaina <rrobaina@redhat.com>

openrisc: pass all six syscall args to audit_syscall_entry()

Update the audit_syscall_entry() call to forward the 5th and 6th syscall
arguments (gpr[7], gpr[8]) now that the audit core logs all six.

> diff --git a/arch/openrisc/kernel/ptrace.c b/arch/openrisc/kernel/ptrace.c
> index 552489b24855c..197a616d6c65c 100644
> --- a/arch/openrisc/kernel/ptrace.c
> +++ b/arch/openrisc/kernel/ptrace.c
> @@ -302,7 +302,8 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
>  		ret = -1L;
>  
>  	audit_syscall_entry(regs->gpr[11], regs->gpr[3], regs->gpr[4],
> -			    regs->gpr[5], regs->gpr[6]);
> +			    regs->gpr[5], regs->gpr[6],
> +			    regs->gpr[7], regs->gpr[8]);

[Severity: Low]
Will this change cause a git bisectability regression if architecture
callers are updated in subsequent commits?

If the core function signature of audit_syscall_entry() was changed in a
previous commit, intermediate commits checked out between the core change
and this architecture update will fail to compile on OpenRISC with a
"too few arguments to function" error.

>  
>  	return ret ? : regs->gpr[11];
>  }

[Severity: High]
This isn't a bug introduced by this patch, but is the return value ignored
by the assembly caller, potentially breaking ptrace syscall abortion?

If tracing decides a syscall should not happen (e.g., via PTRACE_SYSEMU)
and ptrace_report_syscall_entry() returns non-zero, this function attempts
to abort the syscall by returning -1L in r11.

However, the caller in arch/openrisc/kernel/entry.S unconditionally
reloads the original syscall number into r11, discarding the return value:

arch/openrisc/kernel/entry.S:_syscall_trace_enter()
    ...
    l.jal   do_syscall_trace_enter
     l.addi r3,r1,0

    /* Restore arguments ... */
    l.lwz   r11,PT_GPR11(r1)
    ...

Can this allow the original syscall to execute regardless of the tracer's
abort request?

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

  reply	other threads:[~2026-08-13 17:20 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 [this message]
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
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=20260813172043.37A671F00A3A@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.