summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2015-05-17 04:33:02 +0200
committerJohn Crispin <blogic@openwrt.org>2015-05-14 05:23:09 +0200
commit91f0891f7e2641330305f16d4738c4fb064c7449 (patch)
tree9b1798bbbdaf171262f38b14ceabcd09e187b2f7
parent11fa67184a3a26830223158345b1e7764bd33710 (diff)
downloadunitd-91f0891f7e2641330305f16d4738c4fb064c7449.tar
unitd-91f0891f7e2641330305f16d4738c4fb064c7449.zip
jail: add support for ARM architecture
SECCOMP_FILTER isn't supported on ARM OABI. Thus enable seccomp support in jail only for EABI. thumb might work as well as it apparently implies EABI, but yet doesn't set __ARM_EABI__. The REG_SYSCALL macro seems to be an unused left-over. However, it's defined for other architectures as well. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
-rw-r--r--jail/seccomp-bpf.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/jail/seccomp-bpf.h b/jail/seccomp-bpf.h
index 1cc2908..40fe7b9 100644
--- a/jail/seccomp-bpf.h
+++ b/jail/seccomp-bpf.h
@@ -68,6 +68,9 @@ struct seccomp_data {
#elif defined(__mips__)
# define REG_SYSCALL regs[2]
# define ARCH_NR AUDIT_ARCH_MIPSEL
+#elif defined(__arm__) && (defined(__ARM_EABI__) || defined(__thumb__))
+# define REG_SYSCALL regs.uregs[7]
+# define ARCH_NR AUDIT_ARCH_ARM
#else
# warning "Platform does not support seccomp filter yet"
# define REG_SYSCALL 0