jail: add support for ARM architecture
authorDaniel Golle <daniel@makrotopia.org>
Sun, 17 May 2015 02:33:02 +0000 (04:33 +0200)
committerJohn Crispin <blogic@openwrt.org>
Thu, 14 May 2015 03:23:09 +0000 (05:23 +0200)
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>
jail/seccomp-bpf.h

index 1cc2908dada124ef7991d6ab21b3a1165bb4a239..40fe7b9c4fa8ba3af5ebdb549b84ac4674c6ebf3 100644 (file)
@@ -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