xref: /linux/arch/x86/include/asm/seccomp.h (revision 36ec807b627b4c0a0a382f0ae48eac7187d14b2b)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
28eb68bf7SKees Cook #ifndef _ASM_X86_SECCOMP_H
38eb68bf7SKees Cook #define _ASM_X86_SECCOMP_H
48eb68bf7SKees Cook 
58eb68bf7SKees Cook #include <asm/unistd.h>
68eb68bf7SKees Cook 
796a388deSThomas Gleixner #ifdef CONFIG_X86_32
88eb68bf7SKees Cook #define __NR_seccomp_sigreturn		__NR_sigreturn
996a388deSThomas Gleixner #endif
108eb68bf7SKees Cook 
118eb68bf7SKees Cook #ifdef CONFIG_COMPAT
12*e2d16832SBrian Gerst #include <asm/unistd_32_ia32.h>
138eb68bf7SKees Cook #define __NR_seccomp_read_32		__NR_ia32_read
148eb68bf7SKees Cook #define __NR_seccomp_write_32		__NR_ia32_write
158eb68bf7SKees Cook #define __NR_seccomp_exit_32		__NR_ia32_exit
168eb68bf7SKees Cook #define __NR_seccomp_sigreturn_32	__NR_ia32_sigreturn
178eb68bf7SKees Cook #endif
188eb68bf7SKees Cook 
1925db9120SKees Cook #ifdef CONFIG_X86_64
2025db9120SKees Cook # define SECCOMP_ARCH_NATIVE		AUDIT_ARCH_X86_64
2125db9120SKees Cook # define SECCOMP_ARCH_NATIVE_NR		NR_syscalls
2225db9120SKees Cook # define SECCOMP_ARCH_NATIVE_NAME	"x86_64"
2325db9120SKees Cook # ifdef CONFIG_COMPAT
2425db9120SKees Cook #  define SECCOMP_ARCH_COMPAT		AUDIT_ARCH_I386
2525db9120SKees Cook #  define SECCOMP_ARCH_COMPAT_NR	IA32_NR_syscalls
2625db9120SKees Cook #  define SECCOMP_ARCH_COMPAT_NAME	"ia32"
2725db9120SKees Cook # endif
2825db9120SKees Cook /*
2925db9120SKees Cook  * x32 will have __X32_SYSCALL_BIT set in syscall number. We don't support
3025db9120SKees Cook  * caching them and they are treated as out of range syscalls, which will
3125db9120SKees Cook  * always pass through the BPF filter.
3225db9120SKees Cook  */
3325db9120SKees Cook #else /* !CONFIG_X86_64 */
3425db9120SKees Cook # define SECCOMP_ARCH_NATIVE		AUDIT_ARCH_I386
3525db9120SKees Cook # define SECCOMP_ARCH_NATIVE_NR	        NR_syscalls
3625db9120SKees Cook # define SECCOMP_ARCH_NATIVE_NAME	"ia32"
3725db9120SKees Cook #endif
3825db9120SKees Cook 
398eb68bf7SKees Cook #include <asm-generic/seccomp.h>
408eb68bf7SKees Cook 
418eb68bf7SKees Cook #endif /* _ASM_X86_SECCOMP_H */
42