summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/seccomp.h
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2014-11-28 05:26:39 +0000
committerWill Deacon <will.deacon@arm.com>2014-11-28 10:24:59 +0000
commita1ae65b219416a72c15577bd4c8c11174fffbb8b (patch)
tree653e0ac5fd6ffd3beb5dc78755a9f89602bc5b56 /arch/arm64/include/asm/seccomp.h
parentcc5e9097c9aad6b186a568c534e26746d6bfa483 (diff)
downloadop-kernel-dev-a1ae65b219416a72c15577bd4c8c11174fffbb8b.zip
op-kernel-dev-a1ae65b219416a72c15577bd4c8c11174fffbb8b.tar.gz
arm64: add seccomp support
secure_computing() is called first in syscall_trace_enter() so that a system call will be aborted quickly without doing succeeding syscall tracing if seccomp rules want to deny that system call. On compat task, syscall numbers for system calls allowed in seccomp mode 1 are different from those on normal tasks, and so _NR_seccomp_xxx_32's need to be redefined. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/seccomp.h')
-rw-r--r--arch/arm64/include/asm/seccomp.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/seccomp.h b/arch/arm64/include/asm/seccomp.h
new file mode 100644
index 0000000..c76fac9
--- /dev/null
+++ b/arch/arm64/include/asm/seccomp.h
@@ -0,0 +1,25 @@
+/*
+ * arch/arm64/include/asm/seccomp.h
+ *
+ * Copyright (C) 2014 Linaro Limited
+ * Author: AKASHI Takahiro <takahiro.akashi@linaro.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef _ASM_SECCOMP_H
+#define _ASM_SECCOMP_H
+
+#include <asm/unistd.h>
+
+#ifdef CONFIG_COMPAT
+#define __NR_seccomp_read_32 __NR_compat_read
+#define __NR_seccomp_write_32 __NR_compat_write
+#define __NR_seccomp_exit_32 __NR_compat_exit
+#define __NR_seccomp_sigreturn_32 __NR_compat_rt_sigreturn
+#endif /* CONFIG_COMPAT */
+
+#include <asm-generic/seccomp.h>
+
+#endif /* _ASM_SECCOMP_H */
OpenPOWER on IntegriCloud