From: "Michal Suchánek" <msuchanek@suse.de>
To: Renzo Davoli <renzo@cs.unibo.it>
Cc: linux-kernel@vger.kernel.org, Oleg Nesterov <oleg@redhat.com>,
Kees Cook <kees@kernel.org>,
Andy Lutomirski <luto@amacapital.net>,
Will Drewry <wad@chromium.org>, Thomas Gleixner <tglx@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Shuah Khan <shuah@kernel.org>, "Dmitry V . Levin" <ldv@strace.io>,
Alexey Gladkov <legion@kernel.org>,
Eugene Syromyatnikov <evgsyr@gmail.com>,
Davide Berardi <berardi.dav@gmail.com>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
linux-kselftest@vger.kernel.org, strace-devel@lists.strace.io
Subject: Re: [PATCH v11 0/3] PTRACE_SET_SYSCALL_INFO: add support for seccomp syscall skipping
Date: Wed, 18 Nov 2026 14:33:56 +0100 [thread overview]
Message-ID: <av2pRG1JT9te8IiM@kunlun.suse.cz> (raw)
In-Reply-To: <av2i9kbZyMRJE9D6@cs.unibo.it>
On Wed, Nov 18, 2026 at 02:07:02PM +0100, Renzo Davoli wrote:
> On Wed, Nov 18, 2026 at 12:42:32PM +0100, Michal Suchánek wrote:
> > from a user point of view it is not clear to me why this would be done
> > at the seccomp event when seccomp is not used.
>
> Hi Michal,
>
> thank you for the review.
>
> You are right, and the cover letter does not explain it (only patch 2
> does, briefly). The series is limited to the PTRACE_EVENT_SECCOMP stop
> because that is the only stop where a syscall can currently be skipped
> with a preset return value in an architecture independent way: the
> tracer's request goes through the same path as SECCOMP_RET_ERRNO,
> which every architecture already handles.
>
> At the syscall entry stop this depends on the architecture's entry
> code. On some architectures (e.g. MIPS) the entry path overwrites the
> return value with -ENOSYS when the syscall is skipped, so the value set
> by the tracer is lost. A tracer that does not otherwise use seccomp
> has to install a SECCOMP_RET_TRACE filter to use this feature.
>
> > On s390 the removal of such architecture-specific flag is proposed here:
> > [...]
> > While that shows a way to address this problem not all affected
> > architectures implement it.
>
> Thanks for the pointer. With 05c033db7e9a ("entry, treewide: Make
> syscall_enter_from_user_mode[_work]() indicate syscall execution") and
> Heiko's s390 fix, the architectures using the generic entry code
> preset -ENOSYS and leave the return value alone when the syscall is
> skipped, so skipping at the entry stop could be supported there. As
> in patch 1, a per-task flag checked right after the ptrace entry
> report could be used, so that it does not depend on the syscall
> number.
As I understand it the new s390 code resolves the problem by storing the
syscall number outside of the registers. Then the return value can be
set directly. It does not depend on using the generic entry but on the
architecture adding storage for the syscall number in struct pt_regs,
and implementing the code to determine where to get/set the syscall
value depending on the syscall stage.
However, it seems that extending struct pt_regs breaks userspace ABI
(probably because kernel refuses to transfer partial pt_regs to/fom
userspace) which makes it unclear how the int_code that is used by this
new code could be added to the s390 struct pt_regs in the first place.
Thanks
Michal
next prev parent reply other threads:[~2026-11-18 13:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 18:19 [PATCH v11 0/3] PTRACE_SET_SYSCALL_INFO: add support for seccomp syscall skipping Renzo Davoli
2026-11-14 18:19 ` [PATCH v11 1/3] seccomp: let the tracer skip a syscall independently of its number Renzo Davoli
2026-11-17 16:54 ` Oleg Nesterov
2026-11-14 18:19 ` [PATCH v11 2/3] ptrace: add PTRACE_SET_SYSCALL_INFO syscall skipping support Renzo Davoli
2026-11-17 16:23 ` Oleg Nesterov
2026-11-14 18:19 ` [PATCH v11 3/3] selftests/ptrace: add a test case for PTRACE_SET_SYSCALL_INFO syscall skipping Renzo Davoli
2026-11-18 11:42 ` [PATCH v11 0/3] PTRACE_SET_SYSCALL_INFO: add support for seccomp " Michal Suchánek
2026-11-18 13:07 ` Renzo Davoli
2026-11-18 13:33 ` Michal Suchánek [this message]
2026-11-18 14:11 ` Renzo Davoli
2026-11-18 15:47 ` Michal Suchánek
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=av2pRG1JT9te8IiM@kunlun.suse.cz \
--to=msuchanek@suse.de \
--cc=akpm@linux-foundation.org \
--cc=berardi.dav@gmail.com \
--cc=evgsyr@gmail.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=kees@kernel.org \
--cc=ldv@strace.io \
--cc=legion@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=luto@amacapital.net \
--cc=maddy@linux.ibm.com \
--cc=oleg@redhat.com \
--cc=renzo@cs.unibo.it \
--cc=shuah@kernel.org \
--cc=strace-devel@lists.strace.io \
--cc=tglx@kernel.org \
--cc=tsbogend@alpha.franken.de \
--cc=wad@chromium.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