[PATCH 1/5] ptrace: add PTRACE_SYSCALL_INFO_SECCOMP_SKIP
Oleg Nesterov
oleg at redhat.com
Thu Jul 2 08:43:29 UTC 2026
On 07/01, Renzo Davoli wrote:
>
> --- a/include/uapi/linux/ptrace.h
> +++ b/include/uapi/linux/ptrace.h
> @@ -79,6 +79,7 @@ struct seccomp_metadata {
> #define PTRACE_SYSCALL_INFO_ENTRY 1
> #define PTRACE_SYSCALL_INFO_EXIT 2
> #define PTRACE_SYSCALL_INFO_SECCOMP 3
> +#define PTRACE_SYSCALL_INFO_SECCOMP_SKIP 4
>
> struct ptrace_syscall_info {
> __u8 op; /* PTRACE_SYSCALL_INFO_* */
> diff --git a/kernel/ptrace.c b/kernel/ptrace.c
> index d041645d9d17..ff763c87e4f7 100644
> --- a/kernel/ptrace.c
> +++ b/kernel/ptrace.c
> @@ -1119,12 +1119,22 @@ ptrace_set_syscall_info_exit(struct task_struct *child, struct pt_regs *regs,
> return 0;
> }
>
> +static int
> +ptrace_set_syscall_info_seccomp_skip(struct task_struct *child,
> + struct pt_regs *regs,
> + struct ptrace_syscall_info *info)
> +{
> + syscall_set_nr(child, regs, -1);
> + return ptrace_set_syscall_info_exit(child, regs, info);
> +}
Rather than add the new PTRACE_SYSCALL_INFO_SECCOMP_SKIP, can't we teach
ptrace_set_syscall_info_seccomp() to treat info->entry.nr == -1 as "skip" ?
Note that ptrace_set_syscall_info_seccomp() -> ptrace_set_syscall_info_entry()
already does syscall_set_nr().
And perhaps the changelog should say more about motivation...
See also https://sashiko.dev/#/patchset/20260701150558.330348-1-renzo%40cs.unibo.it
Oleg.
More information about the Strace-devel
mailing list