aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Drewry <wad@chromium.org>2012-02-17 15:03:37 -0600
committerJohn Rigby <john.rigby@linaro.org>2012-05-20 23:42:19 -0600
commit77f466fcbd2cca5734205195fc0ac81da3d427d3 (patch)
tree470a6e03dc26e7f121506e20f702fdac03ce3df9
parent3c26a7674ce2e5cbefa28ff830863e284edf5cfb (diff)
UBUNTU: SAUCE: SECCOMP: asm/syscall.h: add syscall_get_arch
Adds a stub for a function that will return the AUDIT_ARCH_* value appropriate to the supplied task based on the system call convention. For audit's use, the value can generally be hard-coded at the audit-site. However, for other functionality not inlined into syscall entry/exit, this makes that information available. seccomp_filter is the first planned consumer and, as such, the comment indicates a tie to HAVE_ARCH_SECCOMP_FILTER. That is probably an unneeded detail. v14: rebase/nochanges v13: rebase on to 88ebdda6159ffc15699f204c33feb3e431bf9bdc v12: rebase on to linux-next v11: fixed improper return type v10: introduced Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Suggested-by: Roland McGrath <mcgrathr@chromium.org> Signed-off-by: Will Drewry <wad@chromium.org> Signed-off-by: Kees Cook <kees@ubuntu.com>
-rw-r--r--include/asm-generic/syscall.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
index 5c122ae6bfa..a2c13dc40af 100644
--- a/include/asm-generic/syscall.h
+++ b/include/asm-generic/syscall.h
@@ -142,4 +142,18 @@ void syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
unsigned int i, unsigned int n,
const unsigned long *args);
+/**
+ * syscall_get_arch - return the AUDIT_ARCH for the current system call
+ * @task: task of interest, must be in system call entry tracing
+ * @regs: task_pt_regs() of @task
+ *
+ * Returns the AUDIT_ARCH_* based on the system call convention in use.
+ *
+ * It's only valid to call this when @task is stopped on entry to a system
+ * call, due to %TIF_SYSCALL_TRACE, %TIF_SYSCALL_AUDIT, or %TIF_SECCOMP.
+ *
+ * Note, at present this function is only required with
+ * CONFIG_HAVE_ARCH_SECCOMP_FILTER.
+ */
+int syscall_get_arch(struct task_struct *task, struct pt_regs *regs);
#endif /* _ASM_SYSCALL_H */