[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250123223534.GB22814@strace.io>
Date: Fri, 24 Jan 2025 00:35:34 +0200
From: "Dmitry V. Levin" <ldv@...ace.io>
To: Christophe Leroy <christophe.leroy@...roup.eu>
Cc: 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,
Madhavan Srinivasan <maddy@...ux.ibm.com>,
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 Thu, Jan 23, 2025 at 11:07:21PM +0100, Christophe Leroy wrote:
[...]
> To add a bit more to the confusion, a task can be flagged with
> TIF_NOERROR by calling force_successful_syscall_return(), in which case
> even if gpr[3] contains a negative between -MAX_ERRNO and -1 the syscall
> will be handled as successfull hence CCR[SO] won't be set. But it seems
> this is not handled by syscall_set_return_value(). So what will happen
> with time() when approaching year 2036 for instance ?
syscall_set_return_value() takes both "int error" and "long val"
arguments. It doesn't and shouldn't take TIF_NOERROR into account.
With my patch applied, when it's called by PTRACE_SET_SYSCALL_INFO
from do_syscall_trace_leave(), it will properly update gpr[3] and ccr
regardless of TIF_NOERROR. If tracer wants to set an error status for
a syscall that cannot return an error, it's up to the tracer to face the
consequences. Tracers can do it now via PTRACE_SETREGS* anyway.
--
ldv
Powered by blists - more mailing lists