aboutsummaryrefslogtreecommitdiffstats
path: root/features/seccomp/asm-syscall.h-add-syscall_get_arch.patch
diff options
context:
space:
mode:
Diffstat (limited to 'features/seccomp/asm-syscall.h-add-syscall_get_arch.patch')
-rw-r--r--features/seccomp/asm-syscall.h-add-syscall_get_arch.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/features/seccomp/asm-syscall.h-add-syscall_get_arch.patch b/features/seccomp/asm-syscall.h-add-syscall_get_arch.patch
new file mode 100644
index 00000000..d95c897d
--- /dev/null
+++ b/features/seccomp/asm-syscall.h-add-syscall_get_arch.patch
@@ -0,0 +1,59 @@
+From 2ca6c225eacea82fd7fdcd24312c817e1e8352e4 Mon Sep 17 00:00:00 2001
+From: Will Drewry <wad@chromium.org>
+Date: Thu, 12 Apr 2012 16:47:55 -0500
+Subject: [PATCH] asm/syscall.h: add syscall_get_arch
+
+commit 07bd18d00d5dcf84eb22f8120f47f09c3d8fe27d upstream.
+
+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
+CONFIG_HAVE_ARCH_SECCOMP_FILTER.
+
+Suggested-by: Roland McGrath <mcgrathr@chromium.org>
+Signed-off-by: Will Drewry <wad@chromium.org>
+Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
+Acked-by: Eric Paris <eparis@redhat.com>
+
+v18: comment and change reword and rebase.
+v14: rebase/nochanges
+v13: rebase on to 88ebdda6159ffc15699f204c33feb3e431bf9bdc
+v12: rebase on to linux-next
+v11: fixed improper return type
+v10: introduced
+Signed-off-by: James Morris <james.l.morris@oracle.com>
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+---
+ include/asm-generic/syscall.h | 14 ++++++++++++++
+ 1 files changed, 14 insertions(+), 0 deletions(-)
+
+diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
+index 5c122ae..5b09392 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.
++ *
++ * Architectures which permit CONFIG_HAVE_ARCH_SECCOMP_FILTER must
++ * provide an implementation of this.
++ */
++int syscall_get_arch(struct task_struct *task, struct pt_regs *regs);
+ #endif /* _ASM_SYSCALL_H */
+--
+1.7.9.1
+