The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: "Michal Suchánek" <msuchanek@suse.de>
Cc: Renzo Davoli <renzo@cs.unibo.it>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Shuah Khan <shuah@kernel.org>, Alexey Gladkov <legion@kernel.org>,
	Eugene Syromyatnikov <evgsyr@gmail.com>,
	Davide Berardi <berardi.dav@gmail.com>,
	strace-devel@lists.strace.io, "Dmitry V . Levin" <ldv@strace.io>
Subject: Re: [PATCH v5 0/2] PTRACE_SET_SYSCALL_INFO: add support for seccomp syscall skipping
Date: Mon, 13 Jul 2026 22:45:27 +0200	[thread overview]
Message-ID: <alVOZ53ob7Bp45NE@redhat.com> (raw)
In-Reply-To: <alER-CLAgNdLQjRU@kunlun.suse.cz>

Michal, thanks for your comments.

On 07/10, Michal Suchánek wrote:
>
> this will not work at least on powerpc, and possibly s390x.
>
> On these architectures the syscall number and the syscall return value
> share the same register.

You know, PTRACE_{GET,SET}_SYSCALL_INFO code is not is not trivial in
that it tries to provide the arch-neutral API to user-space, and thus
we need help from experts who understand the non-x86 low level details.

So perhaps you can provide more details to explain whats wrong with ppc?
I too can't understand the problem.

> However, the tracing hook in seccomp does not return anything, in
> particular it does not change the return value of __secure_computing().
>
>                 /* Allow the BPF to provide the event message */
>                 ptrace_event(PTRACE_EVENT_SECCOMP, data);

Sorry, I don't understand. __secure_computing(SECCOMP_RET_TRACE)
checks syscall_get_nr() checks syscall_get_nr() and returns -1 if
this_syscall < 0.

Note also SECCOMP_RET_USER_NOTIF, this path can skip syscall and it
does syscall_set_return_value(). But yes, this path doesn't use
syscall_set_nr().

> Other ways to rework the setting of the return value are possible. eg.
> it was suggested to add a special field to pt_regs to hold the syscall
> return value, and only copy it to the register at syscall exit.

Or we can add PTRACE_SKIP_SYSCALL set by ptrace_set_syscall_info() and
checked/cleared by ptrace_report_syscall_entry(). Although I'd like to
avoid this at least right now.

In short. Thanks again, but I can't understand your email. Please add
more details?

Oleg.


      parent reply	other threads:[~2026-07-13 20:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 10:09 [PATCH v5 0/2] PTRACE_SET_SYSCALL_INFO: add support for seccomp syscall skipping Renzo Davoli
2026-07-09 10:09 ` [PATCH v5 1/2] ptrace: add PTRACE_SET_SYSCALL_INFO syscall skipping support Renzo Davoli
2026-07-09 10:09 ` [PATCH v5 2/2] selftests/ptrace: add a test case for PTRACE_SET_SYSCALL_INFO syscall skipping Renzo Davoli
2026-07-10 15:38 ` [PATCH v5 0/2] PTRACE_SET_SYSCALL_INFO: add support for seccomp " Michal Suchánek
2026-07-10 16:49   ` Renzo Davoli
2026-07-13 20:45   ` Oleg Nesterov [this message]

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=alVOZ53ob7Bp45NE@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=berardi.dav@gmail.com \
    --cc=evgsyr@gmail.com \
    --cc=ldv@strace.io \
    --cc=legion@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=msuchanek@suse.de \
    --cc=renzo@cs.unibo.it \
    --cc=shuah@kernel.org \
    --cc=strace-devel@lists.strace.io \
    /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