[PATCH v3 6/7] arm64: ptrace: Use NO_SYSCALL instead of -1 in syscall_trace_enter()

Will Deacon will at kernel.org
Fri Jul 10 12:11:48 EDT 2020


On Fri, Jul 10, 2020 at 09:04:08AM -0700, Kees Cook wrote:
> On Fri, Jul 10, 2020 at 02:07:01PM +0100, Will Deacon wrote:
> > Setting a system call number of -1 is special, as it indicates that the
> > current system call should be skipped.
> > 
> > Use NO_SYSCALL instead of -1 when checking for this scenario, which is
> > different from the -1 returned due to a seccomp failure.
> 
> I can't understand this paragraph. NO_SYSCALL is -1, so how is this
> "different"?
> 
> arch/arm64/include/asm/ptrace.h:#define NO_SYSCALL (-1)
> 
> Do you just mean "stop using a literal '-1'"?

Yes, I'm trying to distinguish '-1' when used as a system call number
from '-1' when used as the return value of secure_computing() on failure.
It's currently all mixed up, and I think it's confusing trying to realise
what is a system call number and what is an error code.

Will



More information about the linux-arm-kernel mailing list