lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250121124240.GA26746@strace.io>
Date: Tue, 21 Jan 2025 14:42:40 +0200
From: "Dmitry V. Levin" <ldv@...ace.io>
To: Madhavan Srinivasan <maddy@...ux.ibm.com>
Cc: Christophe Leroy <christophe.leroy@...roup.eu>,
	Alexey Gladkov <legion@...nel.org>, Oleg Nesterov <oleg@...hat.com>,
	Michael Ellerman <mpe@...erman.id.au>,
	Eugene Syromyatnikov <evgsyr@...il.com>,
	Mike Frysinger <vapier@...too.org>,
	Renzo Davoli <renzo@...unibo.it>,
	Davide Berardi <berardi.dav@...il.com>,
	strace-devel@...ts.strace.io, Nicholas Piggin <npiggin@...il.com>,
	Naveen N Rao <naveen@...nel.org>, linuxppc-dev@...ts.ozlabs.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/7] powerpc: properly negate error in
 syscall_set_return_value()

On Tue, Jan 21, 2025 at 05:55:40PM +0530, Madhavan Srinivasan wrote:
> On 1/21/25 4:58 PM, Christophe Leroy wrote:
> > Le 21/01/2025 à 12:13, Madhavan Srinivasan a écrit :
> >> On 1/20/25 10:42 PM, Dmitry V. Levin wrote:
> >>> On Mon, Jan 20, 2025 at 02:51:38PM +0100, Christophe Leroy wrote:
> >>>> Le 14/01/2025 à 18:04, Dmitry V. Levin a écrit :
> >>>>> On Mon, Jan 13, 2025 at 06:34:44PM +0100, Christophe Leroy wrote:
> >>>>>> Le 13/01/2025 à 18:10, Dmitry V. Levin a écrit :
> >>>>>>> Bring syscall_set_return_value() in sync with syscall_get_error(),
> >>>>>>> and let upcoming ptrace/set_syscall_info selftest pass on powerpc.
> >>
> >> Sorry for getting to this thread late.
> >>
> >> Tried the series without this patch in
> >>
> >> 1) power9 PowerNV system and in power10 pSeries lpar
> >>
> >> # ./set_syscall_info
> >> TAP version 13
> >> 1..1
> >> # Starting 1 tests from 1 test cases.
> >> #  RUN           global.set_syscall_info ...
> >> #            OK  global.set_syscall_info
> >> ok 1 global.set_syscall_info
> >> # PASSED: 1 / 1 tests passed.
> >> # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0
> >>
> >> and in both case set_syscall_info passes.
> >> Will look at it further.
> > 
> > I guess it works because power9/10 are using scv not sc for system call, hence using the new ABI ?
> 
> yeah, I guess.
> This is from the a Power8 pSeries lpar without this patch
> 
> # ./set_syscall_info 
> TAP version 13
> 1..1
> # Starting 1 tests from 1 test cases.
> #  RUN           global.set_syscall_info ...
> # set_syscall_info.c:428:set_syscall_info:wait #5: unexpected stop signal 11
> # 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've enhanced error diagnostics of the test a bit.  Inspired by this
powerpc bug, in the next iteration of the patchset the test would also
invoke PTRACE_GET_SYSCALL_INFO right after PTRACE_SET_SYSCALL_INFO to
check whether the changes are applied by the kernel correctly.
Without the fix, in non-svc case the test would complain this way:

# set_syscall_info.c:119:set_syscall_info:Expected exp_exit->rval (-38) == info->exit.rval (38)
# set_syscall_info.c:120:set_syscall_info:wait #4: PTRACE_GET_SYSCALL_INFO #2: exit stop mismatch


-- 
ldv

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ