From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F6EE33EAF9 for ; Fri, 20 Feb 2026 10:58:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771585107; cv=none; b=aU2j5z6FI2d4AmTKjmaZT9uj/Lq9RtlVQ6Z0S42Tk2lpw38BeqmgGLyFfiqo1yuwMxxK8sUSJM98pi3KhK0N7zj7qZx0MsHmv2ivfFwijsZkmnVY9xiV7Jz6sXAuGok83dQ7yHlYt1NyOPBc8UOzElxa6ivTdbSRX3/8ePkaShE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771585107; c=relaxed/simple; bh=ZPsdS+wHgzw9QeW9jt2d5f4gTTX82BrqYLt3i6HF1UY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=psI9b3tPDJ+ECKoEaPr2spUnnDS6X4E0mmr3/ZIA7mdPkF4RmXhqO7y1lW/Ylzqnp0aIcSqoO5wJlBBxuT6BQMuk3tnE/DTnmOCm0+6XndKN7h+5/0a1ZRN/7KZBeJQGnRYS9ETYGH6JDoxUSiMV7xV1HyjEW0ZUoxGlyWeDUdo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dUakKLln; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dUakKLln" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-59e646a4b9eso1728877e87.3 for ; Fri, 20 Feb 2026 02:58:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771585104; x=1772189904; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=74lRYbjOb2rRE375diWhyXReQIshWq2MXS1nfSaGpxk=; b=dUakKLlnjHGirT2UL0s7IRlMvS2Yik5Y3Ce6wYqykvVojTlHYktg/nLOr/H7X7hBh/ CKoIwfQdDsTikFC6AteBLxQn56Cno4E6CgAo+iYfpiPDy0Rc7o7bg3FmehZ+lfUf3li4 S92rKCx+Zr2eqDaFCWFzsNh254Zxa35MFLDsexyDFHjPJVNZPiLUCv4ATm4KGG5Zas/u HhTeIxbkRHDhhcQHNzM0bXeDuYWHZvI/fFgYwJoisVBQfyg7fzdbt8JEvv7ryJSaP2vK RcHT6bGUVsE0ED0f9VzvE1Ok6qSXPXDTLbd2yMKRDzPDcTiIQm1t17tmcPo8kfsCX34U a5nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771585104; x=1772189904; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=74lRYbjOb2rRE375diWhyXReQIshWq2MXS1nfSaGpxk=; b=c5+40BkjTUMIZSLqv/l8Z+J5mu44Zhw8cfoXT+4LgNBsjXMvnaZw4nw1/Ni9W7Jcej zy2cPEGqbB8C5a2QTND+Hf4QjR6+xc0eK48uRAXAcwFXBRdOlufbxesdqUI0ntERiFUV IX2+LtpCrgKpdD4oeJ065cYfJOr4ca6d3E8psBhCnrstf3UT4UB/pdyHwR6NN8yu+4aG dsNx3CByrb6mzCdmLKDw9jC4mrvCqU6VTtZLrLiY5LjawaeUzUOtKdk4SwYq96DABP2t ChrMgpTeNya0rODe6xrLtx20sas6D4isksfrkP3dQb4mlGACq3kT9DT26IwzyFiRLu/v yeXw== X-Forwarded-Encrypted: i=1; AJvYcCWwoEWoT7oTyIX7ZiJ4Nz6ilSFB8czmAJIkFZ9L5NRJBP1R0ETTJGXCs7E3mb6EEhzMMSMSZeIwA3c7/E8=@vger.kernel.org X-Gm-Message-State: AOJu0YxVvrIhMVhZ31vtwRJIJgSjG3SMOJkOb4Xj3aT+kMOq0X632ZYj lbGaHMz25ycdENR0Su40gzgl/9U+AjHyw1mG4RsS/mn5K/+qhGa2+ge5 X-Gm-Gg: AZuq6aK6qD87ZdgBCtkq5IZjh7sRnkDraOuFJv1Gg5qb49/GTUgMpyMX6ybR7+MTEOX VnvsHBx24ImhSnl8ws/wwwn3gTfH36xNxjrgFK5A7WzyA7EIGTSuosd/TGPOMWPPdtrijjjyiXI 0jt/tJqujhtB3zKZyRFyKFz1dS+ZplKwkxi78OTV5LXPxpymsFwLx81H1lljMckUizoZz0NFWZP me18vbL1pkuJ4HszeUS2UKnF6jMZSyKOolim1xOuBlreX1+xVyXAWe2LiwBbWBDFMamcfpmna4t 6zIKfEKBB+aXjB6IXSPIUvXhG0zIIH+/ktLmLE0mQAic7AQz9gn1G+3kVII8USZhA9ZgCAMjTjv TldbtTTWCM7sZqFj8RgyZ1Updx86S7ka3dYPRjMM64q2cEK/3RypRdFZeD1aQ0xgTDvzSBUIIGS ctHZzi2Aw+SFOX+SPXKwFBKGfvVTPsg1Qlm2fiplLNtK1hKkmlKHGmsCqg+04ww40qg6m9PRkzw OsJ83AdQrZv96F9mbLtjQZsqogWtu9Lbe4= X-Received: by 2002:a05:6512:39d1:b0:59e:5cf8:56b5 with SMTP id 2adb3069b0e04-59f6d37997cmr6519932e87.26.1771585104127; Fri, 20 Feb 2026 02:58:24 -0800 (PST) Received: from buildhost.darklands.se (h-94-254-104-176.A469.priv.bahnhof.se. [94.254.104.176]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-59e5f5b2239sm5902530e87.81.2026.02.20.02.58.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Feb 2026 02:58:23 -0800 (PST) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, corbet@lwn.net, linux-doc@vger.kernel.org Cc: glaubitz@physik.fu-berlin.de, macro@orcam.me.uk, macro@redhat.com, mcree@orcon.net.nz, ink@unseen.parts, Magnus Lindholm Subject: [PATCH v2 0/1] alpha: add support for SECCOMP and SECCOMP_FILTER Date: Fri, 20 Feb 2026 11:50:09 +0100 Message-ID: <20260220105757.25104-1-linmag7@gmail.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. --- Changes since v1: - Update features documentation for seccomp-filter/alpha Link: https://lore.kernel.org/linux-alpha/20260205133049.526-1-linmag7@gmail.com/T/#t Magnus Lindholm (1): alpha: add support for SECCOMP and SECCOMP_FILTER .../seccomp/seccomp-filter/arch-support.txt | 2 +- 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 +++++++++++- 7 files changed, 305 insertions(+), 24 deletions(-) create mode 100644 arch/alpha/include/asm/seccomp.h -- 2.52.0