From: Ricardo Robaina <rrobaina@redhat.com>
To: audit@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-alpha@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org,
linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org,
linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org,
sparclinux@vger.kernel.org, linux-um@lists.infradead.org,
bpf@vger.kernel.org
Cc: paul@paul-moore.com, eparis@redhat.com, sgrubb@redhat.com,
oleg@redhat.com, richard.henderson@linaro.org,
mattst88@gmail.com, linmag7@gmail.com, linux@armlinux.org.uk,
catalin.marinas@arm.com, will@kernel.org, guoren@kernel.org,
monstr@monstr.eu, tsbogend@alpha.franken.de, jonas@southpole.se,
stefan.kristiansson@saunalahti.fi, shorne@gmail.com,
James.Bottomley@HansenPartnership.com, deller@gmx.de,
ysato@users.sourceforge.jp, dalias@libc.org,
glaubitz@physik.fu-berlin.de, davem@davemloft.net,
andreas@gaisler.com, richard@nod.at,
anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net,
chris@zankel.net, jcmvbkbc@gmail.com, tglx@kernel.org,
peterz@infradead.org, luto@kernel.org,
Ricardo Robaina <rrobaina@redhat.com>
Subject: [PATCH v3 00/14] audit: log all six syscall arguments in the SYSCALL record
Date: Tue, 22 Sep 2026 16:19:52 -0300 [thread overview]
Message-ID: <cover.1790088067.git.rrobaina@redhat.com> (raw)
The SYSCALL record currently logs only four of the six syscall
arguments (a0-a3), silently discarding the remaining two. This
leads to the need for auxiliary records when audit-relevant
data lands in the 5th or 6th argument of a syscall.
This series extends the SYSCALL record to log all six arguments,
by adding arguments a4 and a5 inline within the existing record.
Rather than plumbing two more argument registers through every
architecture's syscall entry path, audit_syscall_entry() now takes a
struct pt_regs * and retrieves all six arguments itself via
syscall_get_arguments(); the per-arch patches simply pass regs. The two
new arguments are also wired into the audit filter, so rules can match
on a4 and a5.
To keep the series bisectable, the new pt_regs-based helpers are added
first (patch 1), each architecture is converted one per patch, and the
final patch removes the legacy argument-register helpers and renames the
new ones back to audit_syscall_entry(). Every commit builds on its own.
The audit testsuite runs successfully:
# make test
make -C tests test
Running as user root
with context unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
on system Fedora
amcast_joinpart/test ................. ok
backlog_wait_time_actual_reset/test .. ok
bpf/test ............................. ok
coredump/test ........................ ok
exec_execve/test ..................... ok
exec_name/test ....................... ok
fanotify/test ........................ ok
field_compare/test ................... ok
file_create/test ..................... ok
file_delete/test ..................... ok
file_permission/test ................. ok
file_rename/test ..................... ok
filter_device/test ................... ok
filter_exclude/test .................. ok
filter_exit/test ..................... ok
filter_inode/test .................... ok
filter_saddr_fam/test ................ ok
filter_sessionid/test ................ ok
io_uring/test ........................ ok
login_tty/test ....................... ok
lost_reset/test ...................... ok
netfilter_pkt/test ................... ok
signal/test .......................... ok
syscalls_file/test ................... ok
syscall_module/test .................. ok
syscall_socketcall/test .............. ok
time_change/test ..................... ok
user_msg/test ........................ ok
All tests successful.
Result: PASS
Changes in v3:
- Make the series bisectable, as requested by Will Deacon. Rather
than changing __audit_syscall_entry()'s signature in place (which
broke the build between the core patch and the per-arch conversions),
patch 1 now adds audit_syscall_entry_regs()/__audit_syscall_entry_regs()
alongside the existing helpers. The per-arch patches switch to the new
helpers, and the final patch removes the legacy helpers and renames
the new ones back to audit_syscall_entry().
- Drop the alpha conversion patch. Per Magnus Lindholm, alpha is
being moved onto the generic entry framework, which removes its
private syscall_trace_enter() and routes syscall auditing through
syscall_enter_audit(); no alpha-specific change is needed once that
series lands. This series should therefore be applied on top of it.
- Add "parisc: mask compat syscall arguments in syscall_get_arguments()"
(new patch 8). Moving argument retrieval into syscall_get_arguments()
would otherwise drop the low-32-bit masking parisc previously did
inline in its compat audit path, exposing the upper 32 bits of the
argument registers to audit (and seccomp) for 32-bit tasks. Mask in
the helper instead, before the parisc conversion, so the series stays
correct and bisectable.
Changes in v2:
- Rework the core change per Will Deacon's suggestion: instead of
plumbing all six arguments through every architecture's syscall
entry path, __audit_syscall_entry() now takes a struct pt_regs *
and retrieves the arguments itself via syscall_get_arguments().
- Per-arch patches now simply pass regs instead of the individual
argument registers.
- Fetch the arguments directly into context->argv, dropping the
temporary array.
Ricardo Robaina (14):
audit: log all six syscall arguments in the SYSCALL record
arm: pass pt_regs to audit_syscall_entry()
arm64: pass pt_regs to audit_syscall_entry()
csky: pass pt_regs to audit_syscall_entry()
microblaze: pass pt_regs to audit_syscall_entry()
mips: pass pt_regs to audit_syscall_entry()
openrisc: pass pt_regs to audit_syscall_entry()
parisc: mask compat syscall arguments in syscall_get_arguments()
parisc: pass pt_regs to audit_syscall_entry()
sh: pass pt_regs to audit_syscall_entry()
sparc64: pass pt_regs to audit_syscall_entry()
um: pass pt_regs to audit_syscall_entry()
xtensa: pass pt_regs to audit_syscall_entry()
audit: rename audit_syscall_entry_regs() to audit_syscall_entry()
arch/arm/kernel/ptrace.c | 3 +--
arch/arm64/kernel/ptrace.c | 3 +--
arch/csky/kernel/ptrace.c | 2 +-
arch/microblaze/kernel/ptrace.c | 2 +-
arch/mips/kernel/ptrace.c | 4 +---
arch/openrisc/kernel/ptrace.c | 3 +--
arch/parisc/include/asm/syscall.h | 18 ++++++++++++------
arch/parisc/kernel/ptrace.c | 9 ++-------
arch/sh/kernel/ptrace_32.c | 3 +--
arch/sparc/kernel/ptrace_64.c | 4 +---
arch/um/kernel/ptrace.c | 6 +-----
arch/xtensa/kernel/ptrace.c | 4 +---
include/linux/audit.h | 13 ++++---------
include/uapi/linux/audit.h | 2 ++
kernel/audit.h | 2 +-
kernel/auditfilter.c | 2 ++
kernel/auditsc.c | 19 ++++++++-----------
kernel/entry/syscall-common.c | 4 +---
18 files changed, 42 insertions(+), 61 deletions(-)
--
2.55.0
next reply other threads:[~2026-09-22 19:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 19:19 Ricardo Robaina [this message]
2026-09-22 19:19 ` [PATCH v3 01/14] " Ricardo Robaina
2026-09-23 11:29 ` Oleg Nesterov
2026-09-22 19:19 ` [PATCH v3 02/14] arm: pass pt_regs to audit_syscall_entry() Ricardo Robaina
2026-09-22 19:19 ` [PATCH v3 03/14] arm64: " Ricardo Robaina
2026-09-22 19:19 ` [PATCH v3 04/14] csky: " Ricardo Robaina
2026-09-22 19:19 ` [PATCH v3 05/14] microblaze: " Ricardo Robaina
2026-09-22 19:19 ` [PATCH v3 06/14] mips: " Ricardo Robaina
2026-09-22 19:19 ` [PATCH v3 07/14] openrisc: " Ricardo Robaina
2026-09-22 19:20 ` [PATCH v3 08/14] parisc: mask compat syscall arguments in syscall_get_arguments() Ricardo Robaina
2026-09-22 19:20 ` [PATCH v3 09/14] parisc: pass pt_regs to audit_syscall_entry() Ricardo Robaina
2026-09-22 19:20 ` [PATCH v3 10/14] sh: " Ricardo Robaina
2026-09-22 19:20 ` [PATCH v3 11/14] sparc64: " Ricardo Robaina
2026-09-22 19:20 ` [PATCH v3 12/14] um: " Ricardo Robaina
2026-09-22 19:20 ` [PATCH v3 13/14] xtensa: " Ricardo Robaina
2026-09-22 19:20 ` [PATCH v3 14/14] audit: rename audit_syscall_entry_regs() " Ricardo Robaina
2026-09-23 11:30 ` Oleg Nesterov
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=cover.1790088067.git.rrobaina@redhat.com \
--to=rrobaina@redhat.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=andreas@gaisler.com \
--cc=anton.ivanov@cambridgegreys.com \
--cc=audit@vger.kernel.org \
--cc=bpf@vger.kernel.org \
--cc=catalin.marinas@arm.com \
--cc=chris@zankel.net \
--cc=dalias@libc.org \
--cc=davem@davemloft.net \
--cc=deller@gmx.de \
--cc=eparis@redhat.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=guoren@kernel.org \
--cc=jcmvbkbc@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=jonas@southpole.se \
--cc=linmag7@gmail.com \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-csky@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-openrisc@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=luto@kernel.org \
--cc=mattst88@gmail.com \
--cc=monstr@monstr.eu \
--cc=oleg@redhat.com \
--cc=paul@paul-moore.com \
--cc=peterz@infradead.org \
--cc=richard.henderson@linaro.org \
--cc=richard@nod.at \
--cc=sgrubb@redhat.com \
--cc=shorne@gmail.com \
--cc=sparclinux@vger.kernel.org \
--cc=stefan.kristiansson@saunalahti.fi \
--cc=tglx@kernel.org \
--cc=tsbogend@alpha.franken.de \
--cc=will@kernel.org \
--cc=ysato@users.sourceforge.jp \
/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
all inboxes | Powered by JetHome®