aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWill Drewry <wad@chromium.org>2012-02-22 10:59:31 -0600
committerJohn Rigby <john.rigby@linaro.org>2012-06-20 20:14:11 -0600
commit872ac0903f918f7d3c390b6638681cdb74f71b3e (patch)
treecd321c7b5370a12ff745a1978938bf890c3d3251 /include
parentd9cbcfdc620003a5cef55245f49235d1dc5ba569 (diff)
UBUNTU: SAUCE: SECCOMP: net/compat.c,linux/filter.h: share compat_sock_fprog
Any other users of bpf_*_filter that take a struct sock_fprog from userspace will need to be able to also accept a compat_sock_fprog if the arch supports compat calls. This change let's the existing compat_sock_fprog be shared. v14: rebase/nochanges v13: rebase on to 88ebdda6159ffc15699f204c33feb3e431bf9bdc v12: rebase on to linux-next v11: introduction Signed-off-by: Will Drewry <wad@chromium.org> Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Kees Cook <kees@ubuntu.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/filter.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h
index aaa2e80630b..f2e53152e83 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -10,6 +10,7 @@
#ifdef __KERNEL__
#include <linux/atomic.h>
+#include <linux/compat.h>
#endif
/*
@@ -132,6 +133,16 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
#ifdef __KERNEL__
+#ifdef CONFIG_COMPAT
+/*
+ * A struct sock_filter is architecture independent.
+ */
+struct compat_sock_fprog {
+ u16 len;
+ compat_uptr_t filter; /* struct sock_filter * */
+};
+#endif
+
struct sk_buff;
struct sock;