Re: [PATCH 2/2] ptrace: is_syscall_success: Add syscall return code handling for compat task

From: Oleg Nesterov
Date: Thu Apr 15 2021 - 01:49:09 EST


On 04/15, He Zhe wrote:
>
>
> On 4/15/21 12:55 AM, Oleg Nesterov wrote:
> > I think in_compat_syscall() should be used instead.
> >
> > But this doesn't matter, I still can't understand the problem.
>
> Sorry for not enough clarification.
>
> This was found on an arm64 kernel running with 32-bit user-space application.

OK, but then I think you should add the arm64 version of is_syscall_success()
into arch/arm4/include/asm/ptrace.h and do not touch the generic version ?

Something like arch/arm64/include/asm/syscall.h:syscall_get_error() which uses
is_compat_thread(). Perhaps you can even do

#define is_syscall_success(regs) \
(syscall_get_error(current, regs) == 0)

Oleg.