From: Magnus Lindholm <linmag7@gmail.com>
To: richard.henderson@linaro.org, mattst88@gmail.com,
glaubitz@physik.fu-berlin.de, macro@orcam.me.uk,
macro@redhat.com, mcree@orcon.net.nz, ink@unseen.parts,
linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org,
kees@kernel.org
Cc: Magnus Lindholm <linmag7@gmail.com>
Subject: [PATCH 0/1] alpha: add support for SECCOMP and SECCOMP_FILTER
Date: Thu, 5 Feb 2026 14:29:14 +0100 [thread overview]
Message-ID: <20260205133049.526-1-linmag7@gmail.com> (raw)
This patch adds SECCOMP and SECCOMP_FILTER support to the Alpha
architecture.
The seccomp-bpf selftests exercise syscall tracing, restart, and signal
interaction paths that were previously untested on Alpha. To support
these, the ptrace/strace syscall path is updated to reliably distinguish
internal skip-dispatch from userspace invalid syscall numbers, ensuring
that syscall(-1) continues to return -ENOSYS with correct r0/a3
semantics.
Supporting seccomp also requires correct syscall restart handling when
ptrace and signal delivery are involved. The traced syscall entry path
now consistently tracks syscall state using r0, r1, and r2 while
preserving Alpha's a3-based error reporting ABI:
- r1 holds the mutable "current" syscall number
- r2 preserves the original syscall number for restart
- r0 and r19 (a3) retain their traditional roles as return value and
error indicator
This separation allows syscall restarts to be gated strictly on valid
ERESTART* return codes in the ptrace/strace paths and prevents
kernel-internal restart values from leaking into userspace.
Alpha also lacked support for PTRACE_GETREGSET(NT_PRSTATUS), causing
ptrace-based seccomp tests to fail with -EIO. Minimal GETREGSET and
SETREGSET support is added to export struct pt_regs directly.
With these changes applied, the seccomp-bpf and ptrace syscall selftests
(seccomp_bpf, extended for Alpha) pass reliably on Alpha systems.
Magnus Lindholm (1):
alpha: add support for SECCOMP and SECCOMP_FILTER
arch/alpha/Kconfig | 2 +
arch/alpha/include/asm/seccomp.h | 13 +++
arch/alpha/include/asm/syscall.h | 90 +++++++++++++++++++-
arch/alpha/include/asm/thread_info.h | 16 +++-
arch/alpha/kernel/entry.S | 123 +++++++++++++++++++++++----
arch/alpha/kernel/ptrace.c | 83 ++++++++++++++++--
6 files changed, 304 insertions(+), 23 deletions(-)
create mode 100644 arch/alpha/include/asm/seccomp.h
--
2.52.0
next reply other threads:[~2026-02-05 13:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-05 13:29 Magnus Lindholm [this message]
2026-02-05 13:29 ` [PATCH 1/1] alpha: add support for SECCOMP and SECCOMP_FILTER Magnus Lindholm
2026-02-05 14:38 ` John Paul Adrian Glaubitz
2026-02-19 21:10 ` Magnus Lindholm
2026-02-19 22:51 ` Michael Cree
2026-02-19 23:06 ` John Paul Adrian Glaubitz
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=20260205133049.526-1-linmag7@gmail.com \
--to=linmag7@gmail.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=ink@unseen.parts \
--cc=kees@kernel.org \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=macro@orcam.me.uk \
--cc=macro@redhat.com \
--cc=mattst88@gmail.com \
--cc=mcree@orcon.net.nz \
--cc=richard.henderson@linaro.org \
/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