Re: [PATCH v2 1/5] ptrace: PTRACE_SET_SYSCALL_INFO syscall skipping support

From: Dmitry V. Levin

Date: Thu Jul 09 2026 - 04:05:06 EST


On Thu, Jul 09, 2026 at 09:04:34AM +0200, Sven Schnelle wrote:
> Renzo Davoli <renzo@xxxxxxxxxxx> writes:
>
> > This patch extends PTRACE_SET_SYSCALL_INFO with support for skipping a system
> > call triggered via seccomp.
> >
> > When the tracer retrieves a ptrace_syscall_info structure with
> > op == PTRACE_SYSCALL_INFO_SECCOMP, it may choose to skip the system
> > call by changing op to PTRACE_SYSCALL_INFO_EXIT and
> > populating the exit union fields (rval and is_error) to define
> > the return value and error status for the tracee.
>
> Is it possible to indicate the information whether the syscall should be
> skipped via a dedicated return value?

Currently, there is no API for that, so everybody has been using -1 for
that purpose.

> There's currently work going on[1]
> to do this for seccomp, and it would be awkward if ptrace introduces
> this at the same time.

If someday there would be a better API for that, ptrace could be able to
use it as well.


--
ldv