arm64: Do not forget syscall when starting a new thread.
authorFrancis Laniel <flaniel@linux.microsoft.com>
Wed, 8 Jun 2022 16:24:46 +0000 (17:24 +0100)
committerWill Deacon <will@kernel.org>
Fri, 1 Jul 2022 11:33:05 +0000 (12:33 +0100)
Enable tracing of the execve*() system calls with the
syscalls:sys_exit_execve tracepoint by removing the call to
forget_syscall() when starting a new thread and preserving the value of
regs->syscallno across exec.

Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
Link: https://lore.kernel.org/r/20220608162447.666494-2-flaniel@linux.microsoft.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/processor.h

index 9e58749..86eb0bf 100644 (file)
@@ -272,8 +272,9 @@ void tls_preserve_current_state(void);
 
 static inline void start_thread_common(struct pt_regs *regs, unsigned long pc)
 {
+       s32 previous_syscall = regs->syscallno;
        memset(regs, 0, sizeof(*regs));
-       forget_syscall(regs);
+       regs->syscallno = previous_syscall;
        regs->pc = pc;
 
        if (system_uses_irq_prio_masking())