Re: [PATCH v11 0/3] PTRACE_SET_SYSCALL_INFO: add support for seccomp syscall skipping

From: Renzo Davoli

Date: Wed Nov 18 2026 - 08:07:24 EST


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.

This series stays limited to the seccomp stop, which works on all
architectures; support for the entry stop on the generic entry
architectures can follow as a separate series. If a new version is
needed, I will also explain the restriction in the cover letter.

Thanks,
renzo