[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220509151958.441240-2-flaniel@linux.microsoft.com>
Date: Mon, 9 May 2022 16:19:57 +0100
From: Francis Laniel <flaniel@...ux.microsoft.com>
To: linux-arm-kernel@...ts.infradead.org
Cc: linux-trace-devel@...r.kernel.org,
Francis Laniel <flaniel@...ux.microsoft.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Mark Brown <broonie@...nel.org>,
Peter Collingbourne <pcc@...gle.com>,
Mark Rutland <mark.rutland@....com>,
Kees Cook <keescook@...omium.org>,
Daniel Kiss <daniel.kiss@....com>, linux-kernel@...r.kernel.org
Subject: [RFC PATCH v1 1/1] arm64: Forget syscall if different from execve*()
This patch enables exeve*() to be traced by syscalls:sys_exit_execve
tracepoint.
Previously, calling forget_syscall() would set syscall to -1, which impedes
this tracepoint to prints its information.
So, this patch makes call to forget_syscall() conditional by only calling
it when syscall number is not execve() or execveat().
Signed-off-by: Francis Laniel <flaniel@...ux.microsoft.com>
---
arch/arm64/include/asm/processor.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
index 73e38d9a540c..e12ceb363d6a 100644
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@ -34,6 +34,8 @@
#include <vdso/processor.h>
+#include <asm-generic/unistd.h>
+
#include <asm/alternative.h>
#include <asm/cpufeature.h>
#include <asm/hw_breakpoint.h>
@@ -250,8 +252,12 @@ 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);
+ if (previous_syscall == __NR_execve || previous_syscall == __NR_execveat)
+ regs->syscallno = previous_syscall;
+ else
+ forget_syscall(regs);
regs->pc = pc;
if (system_uses_irq_prio_masking())
--
2.25.1
Powered by blists - more mailing lists