From: "Dmitry V. Levin" <ldv@strace.io>
To: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: linux-snps-arc@lists.infradead.org, Rich Felker <dalias@libc.org>,
Thomas Gleixner <tglx@linutronix.de>,
Andreas Larsson <andreas@gaisler.com>,
John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
x86@kernel.org, linux-kernel@vger.kernel.org,
"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
Guo Ren <guoren@kernel.org>,
linux-csky@vger.kernel.org, linux-kselftest@vger.kernel.org,
"H. Peter Anvin" <hpa@zytor.com>,
sparclinux@vger.kernel.org, linux-hexagon@vger.kernel.org,
WANG Xuerui <kernel@xen0n.name>,
linux-api@vger.kernel.org, Will Deacon <will@kernel.org>,
Eugene Syromyatnikov <evgsyr@gmail.com>,
Anton Ivanov <anton.ivanov@cambridgegreys.com>,
Jonas Bonn <jonas@southpole.se>,
linux-s390@vger.kernel.org,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Yoshinori Sato <ysato@users.sourceforge.jp>,
linux-sh@vger.kernel.org, Michael Ellerman <mpe@ellerman.id.au>,
Helge Deller <deller@gmx.de>, Huacai Chen <chenhuacai@kernel.org>,
Russell King <linux@armlinux.org.uk>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Dave Hansen <dave.hansen@linux.intel.com>,
Ingo Molnar <mingo@redhat.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Vineet Gupta <vgupta@kernel.org>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Arnd Bergmann <arnd@arndb.de>,
linux-arch@vger.kernel.org, Shuah Khan <shuah@kernel.org>,
Albert Ou <aou@eecs.berkeley.edu>,
Mike Frysinger <vapier@gentoo.org>,
Davide Berardi <berardi.dav@gmail.com>,
Renzo Davoli <renzo@cs.unibo.it>,
linux-um@lists.infradead.org, Heiko Carstens <hca@linux.ibm.com>,
strace-devel@lists.strace.io,
Charlie Jenkins <charlie@rivosinc.com>,
Naveen N Rao <naveen@kernel.org>,
Nicholas Piggin <npiggin@gmail.com>,
Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
linux-m68k@lists.linux-m68k.org, Borislav Petkov <bp@alien8.de>,
loongarch@lists.linux.dev,
Paul Walmsley <paul.walmsley@sifive.com>,
Stafford Horne <shorne@gmail.com>,
Johannes Berg <johannes@sipsolutions.net>,
linux-arm-kernel@lists.infradead.org,
Brian Cain <bcain@quicinc.com>, Michal Simek <monstr@monstr.eu>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
linux-parisc@vger.kernel.org, linux-openrisc@vger.kernel.org,
linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
Oleg Nesterov <oleg@redhat.com>,
Dinh Nguyen <dinguyen@kernel.org>,
linux-riscv@lists.infradead.org,
Palmer Dabbelt <palmer@dabbelt.com>,
Sven Schnelle <svens@linux.ibm.com>,
Richard Weinberger <richard@nod.at>,
Andrew Morton <akpm@linux-foundation.org>,
Alexey Gladkov <legion@kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH v4 0/7] ptrace: introduce PTRACE_SET_SYSCALL_INFO API
Date: Mon, 3 Feb 2025 12:35:43 +0200 [thread overview]
Message-ID: <20250203103542.GA16165@strace.io> (raw)
In-Reply-To: <Z6CMgVm8QKEMRf8L@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com>
On Mon, Feb 03, 2025 at 10:29:37AM +0100, Alexander Gordeev wrote:
> On Mon, Feb 03, 2025 at 08:58:49AM +0200, Dmitry V. Levin wrote:
>
> Hi Dmitry,
>
> > PTRACE_SET_SYSCALL_INFO is a generic ptrace API that complements
> > PTRACE_GET_SYSCALL_INFO by letting the ptracer modify details of
> > system calls the tracee is blocked in.
> ...
>
> FWIW, I am getting these on s390:
>
> # ./tools/testing/selftests/ptrace/set_syscall_info
> TAP version 13
> 1..1
> # Starting 1 tests from 1 test cases.
> # RUN global.set_syscall_info ...
> # set_syscall_info.c:87:set_syscall_info:Expected exp_entry->nr (-1) == info->entry.nr (65535)
> # set_syscall_info.c:88:set_syscall_info:wait #3: PTRACE_GET_SYSCALL_INFO #2: syscall nr mismatch
> # set_syscall_info: Test terminated by assertion
> # FAIL global.set_syscall_info
> not ok 1 global.set_syscall_info
> # FAILED: 0 / 1 tests passed.
> # Totals: pass:0 fail:1 xfail:0 xpass:0 skip:0 error:0
>
> I remember one of the earlier versions (v1 or v2) was working for me.
>
> Thanks!
In v3, this test was extended to check whether PTRACE_GET_SYSCALL_INFO
called immediately after PTRACE_SET_SYSCALL_INFO returns the same syscall
number, and on s390 it apparently doesn't, thanks to its implementation
of syscall_get_nr() that returns 0xffff in this case.
To workaround this, we could either change syscall_get_nr() to return -1
in this case, or add an #ifdef __s390x__ exception to the test.
What would you prefer?
--
ldv
prev parent reply other threads:[~2025-02-03 10:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-03 6:58 [PATCH v4 0/7] ptrace: introduce PTRACE_SET_SYSCALL_INFO API Dmitry V. Levin
2025-02-03 7:00 ` [PATCH v4 3/7] syscall.h: add syscall_set_arguments() Dmitry V. Levin
2025-02-03 7:00 ` [PATCH v4 4/7] syscall.h: introduce syscall_set_nr() Dmitry V. Levin
2025-02-03 9:29 ` [PATCH v4 0/7] ptrace: introduce PTRACE_SET_SYSCALL_INFO API Alexander Gordeev
2025-02-03 10:35 ` 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=20250203103542.GA16165@strace.io \
--to=ldv@strace.io \
--cc=James.Bottomley@hansenpartnership.com \
--cc=agordeev@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=andreas@gaisler.com \
--cc=anton.ivanov@cambridgegreys.com \
--cc=aou@eecs.berkeley.edu \
--cc=arnd@arndb.de \
--cc=bcain@quicinc.com \
--cc=berardi.dav@gmail.com \
--cc=borntraeger@linux.ibm.com \
--cc=bp@alien8.de \
--cc=charlie@rivosinc.com \
--cc=chenhuacai@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=dalias@libc.org \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=deller@gmx.de \
--cc=dinguyen@kernel.org \
--cc=evgsyr@gmail.com \
--cc=geert@linux-m68k.org \
--cc=glaubitz@physik.fu-berlin.de \
--cc=gor@linux.ibm.com \
--cc=guoren@kernel.org \
--cc=hca@linux.ibm.com \
--cc=hpa@zytor.com \
--cc=johannes@sipsolutions.net \
--cc=jonas@southpole.se \
--cc=kernel@xen0n.name \
--cc=legion@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-csky@vger.kernel.org \
--cc=linux-hexagon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-openrisc@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=linux-um@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=loongarch@lists.linux.dev \
--cc=maddy@linux.ibm.com \
--cc=mingo@redhat.com \
--cc=monstr@monstr.eu \
--cc=mpe@ellerman.id.au \
--cc=naveen@kernel.org \
--cc=npiggin@gmail.com \
--cc=oleg@redhat.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=renzo@cs.unibo.it \
--cc=richard@nod.at \
--cc=shorne@gmail.com \
--cc=shuah@kernel.org \
--cc=sparclinux@vger.kernel.org \
--cc=stefan.kristiansson@saunalahti.fi \
--cc=strace-devel@lists.strace.io \
--cc=svens@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=tsbogend@alpha.franken.de \
--cc=vapier@gentoo.org \
--cc=vgupta@kernel.org \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--cc=ysato@users.sourceforge.jp \
/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;
as well as URLs for NNTP newsgroup(s).