[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250203103542.GA16165@strace.io>
Date: Mon, 3 Feb 2025 12:35:43 +0200
From: "Dmitry V. Levin" <ldv@...ace.io>
To: Alexander Gordeev <agordeev@...ux.ibm.com>
Cc: linux-snps-arc@...ts.infradead.org, Rich Felker <dalias@...c.org>,
Thomas Gleixner <tglx@...utronix.de>,
Andreas Larsson <andreas@...sler.com>,
John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
x86@...nel.org, linux-kernel@...r.kernel.org,
"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>,
Guo Ren <guoren@...nel.org>, linux-csky@...r.kernel.org,
linux-kselftest@...r.kernel.org, "H. Peter Anvin" <hpa@...or.com>,
sparclinux@...r.kernel.org, linux-hexagon@...r.kernel.org,
WANG Xuerui <kernel@...0n.name>, linux-api@...r.kernel.org,
Will Deacon <will@...nel.org>,
Eugene Syromyatnikov <evgsyr@...il.com>,
Anton Ivanov <anton.ivanov@...bridgegreys.com>,
Jonas Bonn <jonas@...thpole.se>, linux-s390@...r.kernel.org,
Madhavan Srinivasan <maddy@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
linux-sh@...r.kernel.org, Michael Ellerman <mpe@...erman.id.au>,
Helge Deller <deller@....de>, Huacai Chen <chenhuacai@...nel.org>,
Russell King <linux@...linux.org.uk>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Vineet Gupta <vgupta@...nel.org>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Arnd Bergmann <arnd@...db.de>, linux-arch@...r.kernel.org,
Shuah Khan <shuah@...nel.org>, Albert Ou <aou@...s.berkeley.edu>,
Mike Frysinger <vapier@...too.org>,
Davide Berardi <berardi.dav@...il.com>,
Renzo Davoli <renzo@...unibo.it>, linux-um@...ts.infradead.org,
Heiko Carstens <hca@...ux.ibm.com>, strace-devel@...ts.strace.io,
Charlie Jenkins <charlie@...osinc.com>,
Naveen N Rao <naveen@...nel.org>,
Nicholas Piggin <npiggin@...il.com>,
Stefan Kristiansson <stefan.kristiansson@...nalahti.fi>,
linux-m68k@...ts.linux-m68k.org, Borislav Petkov <bp@...en8.de>,
loongarch@...ts.linux.dev, Paul Walmsley <paul.walmsley@...ive.com>,
Stafford Horne <shorne@...il.com>,
Johannes Berg <johannes@...solutions.net>,
linux-arm-kernel@...ts.infradead.org,
Brian Cain <bcain@...cinc.com>, Michal Simek <monstr@...str.eu>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
linux-parisc@...r.kernel.org, linux-openrisc@...r.kernel.org,
linux-mips@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
Oleg Nesterov <oleg@...hat.com>, Dinh Nguyen <dinguyen@...nel.org>,
linux-riscv@...ts.infradead.org,
Palmer Dabbelt <palmer@...belt.com>,
Sven Schnelle <svens@...ux.ibm.com>,
Richard Weinberger <richard@....at>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexey Gladkov <legion@...nel.org>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH v4 0/7] ptrace: introduce PTRACE_SET_SYSCALL_INFO API
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
Powered by blists - more mailing lists