summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Golle2021-03-19 22:22:44 +0000
committerDaniel Golle2021-03-19 22:25:15 +0000
commitc23d8bf81624469ed97449af7bf9497ee2c351c2 (patch)
treeae7786d0d07cde269e97909fb762c2aa1daaf5bf
parent3e88c6f2b179062160d018aa9da2926dbd185f28 (diff)
downloadprocd-c23d8bf81624469ed97449af7bf9497ee2c351c2.tar.gz
trace: fix build on aarch64
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
-rw-r--r--trace/trace.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/trace/trace.c b/trace/trace.c
index 2fd27b8..dab92e0 100644
--- a/trace/trace.c
+++ b/trace/trace.c
@@ -244,6 +244,12 @@ static void tracer_cb(struct uloop_process *c, int ret)
} else if ((ret >> 16) == PTRACE_EVENT_STOP) {
/* Nothing special to do here */
} else if ((ret >> 8) == (SIGTRAP | (PTRACE_EVENT_SECCOMP << 8))) {
+#ifdef __aarch64__
+ int syscall = -1;
+ struct ptrace_syscall_info ptsi = {.op=PTRACE_SYSCALL_INFO_SECCOMP};
+ if (ptrace(PTRACE_GET_SYSCALL_INFO, c->pid, sizeof(ptsi), &ptsi) != -1)
+ syscall = ptsi.entry.nr;
+#else
int syscall = ptrace(PTRACE_PEEKUSER, c->pid, reg_syscall_nr);
#if defined(__arm__)
ptrace(PTRACE_SET_SYSCALL, c->pid, 0, -1);
@@ -251,6 +257,7 @@ static void tracer_cb(struct uloop_process *c, int ret)
#else
ptrace(PTRACE_POKEUSER, c->pid, reg_syscall_nr, -1);
#endif
+#endif
report_seccomp_vialation(c->pid, syscall);
} else {
inject_signal = WSTOPSIG(ret);