Skip to content

Commit d83ee6e

Browse files
committed
arm64: ptrace: Use NO_SYSCALL instead of -1 in syscall_trace_enter()
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. Cc: Mark Rutland <[email protected]> Cc: Keno Fischer <[email protected]> Cc: Luis Machado <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 139dbe5 commit d83ee6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/kernel/ptrace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,12 +1856,12 @@ int syscall_trace_enter(struct pt_regs *regs)
18561856
if (flags & (_TIF_SYSCALL_EMU | _TIF_SYSCALL_TRACE)) {
18571857
tracehook_report_syscall(regs, PTRACE_SYSCALL_ENTER);
18581858
if (!in_syscall(regs) || (flags & _TIF_SYSCALL_EMU))
1859-
return -1;
1859+
return NO_SYSCALL;
18601860
}
18611861

18621862
/* Do the secure computing after ptrace; failures should be fast. */
18631863
if (secure_computing() == -1)
1864-
return -1;
1864+
return NO_SYSCALL;
18651865

18661866
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
18671867
trace_sys_enter(regs, regs->syscallno);

0 commit comments

Comments
 (0)