From: "Dmitry V. Levin" <ldv@strace.io>
To: Nicholas Piggin <npiggin@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>,
Eugene Syromyatnikov <evgsyr@gmail.com>,
Mike Frysinger <vapier@gentoo.org>,
Renzo Davoli <renzo@cs.unibo.it>,
Davide Berardi <berardi.dav@gmail.com>,
strace-devel@lists.strace.io,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/2] powerpc: change syscall error return scheme
Date: Wed, 29 Jan 2025 16:15:14 +0200 [thread overview]
Message-ID: <20250129141513.GA21809@strace.io> (raw)
In-Reply-To: <20250129132148.301937-1-npiggin@gmail.com>
Hi,
On Wed, Jan 29, 2025 at 11:21:41PM +1000, Nicholas Piggin wrote:
> Hi,
>
> I've been toying with the seccomp vs syscall return value problems, and
> wonder if something like this approach could give us a simpler alternative.
> Basically all the core code uses -errno return value, then we convert it
> to the powerpc convention at the last minute when returning.
>
> This seems to pass the seccomp_bpf test cases when applied with the set
> syscall info ptrace patches
>
> https://lore.kernel.org/lkml/20250113171054.GA589@strace.io/
>
> With patch 1 of that series reverted.
>
> One concern is working out exact details of what tracers can see and
> trying to ensure it doesn't break some corner case.
Does the strace test suite also pass with your changes?
My bet is it doesn't pass because do_syscall_trace_leave() is called
with a different state of struct pt_regs.
As I wrote yesterday, the traditional powerpc sc syscall return ABI is
exposed to user space not just when returning to user space, but, besides
that, at syscall exit tracepoint (trace_sys_exit), ptrace syscall exit
stop (ptrace_report_syscall_exit), and PTRACE_EVENT_SECCOMP stop
(__secure_computing).
There could be other points where this is exposed. For example, on many
architectures the tracer can specify syscall error return value also at
ptrace syscall entry stop (ptrace_report_syscall_entry), but powerpc does
not implement this.
--
ldv
prev parent reply other threads:[~2025-01-29 14:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-29 13:21 [RFC PATCH 0/2] powerpc: change syscall error return scheme Nicholas Piggin
2025-01-29 13:21 ` [RFC PATCH 1/2] powerpc/signal: Clean up pt_regs access Nicholas Piggin
2025-01-29 13:21 ` [RFC PATCH 2/2] powerpc/syscall: rework syscall return value handling Nicholas Piggin
2025-01-29 14:15 ` Dmitry V. Levin [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=20250129141513.GA21809@strace.io \
--to=ldv@strace.io \
--cc=berardi.dav@gmail.com \
--cc=christophe.leroy@csgroup.eu \
--cc=evgsyr@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=oleg@redhat.com \
--cc=renzo@cs.unibo.it \
--cc=strace-devel@lists.strace.io \
--cc=vapier@gentoo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.