summaryrefslogtreecommitdiff
path: root/sandbox-seccomp-filter.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-02-22 11:37:00 +1100
committerDamien Miller <djm@mindrot.org>2013-02-22 11:37:00 +1100
commit91f40d8592562b804813a320a4ac3871dbaaf433 (patch)
tree11c012692061931ce2f673c8b733fa000b5d499b /sandbox-seccomp-filter.c
parenta2b5a4c746871bd32a12a00548ccf1a9c3c21101 (diff)
- (djm) [configure.ac sandbox-seccomp-filter.c] Support for Linux
seccomp-bpf sandbox on ARM. Patch from shawnlandden AT gmail.com; ok dtucker
Diffstat (limited to 'sandbox-seccomp-filter.c')
-rw-r--r--sandbox-seccomp-filter.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c
index ef2b13c4f..e12418399 100644
--- a/sandbox-seccomp-filter.c
+++ b/sandbox-seccomp-filter.c
@@ -44,6 +44,7 @@
44#include <linux/audit.h> 44#include <linux/audit.h>
45#include <linux/filter.h> 45#include <linux/filter.h>
46#include <linux/seccomp.h> 46#include <linux/seccomp.h>
47#include <elf.h>
47 48
48#include <asm/unistd.h> 49#include <asm/unistd.h>
49 50
@@ -90,7 +91,9 @@ static const struct sock_filter preauth_insns[] = {
90 SC_DENY(open, EACCES), 91 SC_DENY(open, EACCES),
91 SC_ALLOW(getpid), 92 SC_ALLOW(getpid),
92 SC_ALLOW(gettimeofday), 93 SC_ALLOW(gettimeofday),
94#ifdef __NR_time /* not defined on EABI ARM */
93 SC_ALLOW(time), 95 SC_ALLOW(time),
96#endif
94 SC_ALLOW(read), 97 SC_ALLOW(read),
95 SC_ALLOW(write), 98 SC_ALLOW(write),
96 SC_ALLOW(close), 99 SC_ALLOW(close),
@@ -102,7 +105,12 @@ static const struct sock_filter preauth_insns[] = {
102 SC_ALLOW(select), 105 SC_ALLOW(select),
103#endif 106#endif
104 SC_ALLOW(madvise), 107 SC_ALLOW(madvise),
108#ifdef __NR_mmap2 /* EABI ARM only has mmap2() */
109 SC_ALLOW(mmap2),
110#endif
111#ifdef __NR_mmap
105 SC_ALLOW(mmap), 112 SC_ALLOW(mmap),
113#endif
106 SC_ALLOW(munmap), 114 SC_ALLOW(munmap),
107 SC_ALLOW(exit_group), 115 SC_ALLOW(exit_group),
108#ifdef __NR_rt_sigprocmask 116#ifdef __NR_rt_sigprocmask