seccomp.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_X86_SECCOMP_H
  3. #define _ASM_X86_SECCOMP_H
  4. #include <asm/unistd.h>
  5. #ifdef CONFIG_X86_32
  6. #define __NR_seccomp_sigreturn __NR_sigreturn
  7. #endif
  8. #ifdef CONFIG_COMPAT
  9. #include <asm/ia32_unistd.h>
  10. #define __NR_seccomp_read_32 __NR_ia32_read
  11. #define __NR_seccomp_write_32 __NR_ia32_write
  12. #define __NR_seccomp_exit_32 __NR_ia32_exit
  13. #define __NR_seccomp_sigreturn_32 __NR_ia32_sigreturn
  14. #endif
  15. #ifdef CONFIG_X86_64
  16. # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_X86_64
  17. # define SECCOMP_ARCH_NATIVE_NR NR_syscalls
  18. # define SECCOMP_ARCH_NATIVE_NAME "x86_64"
  19. # ifdef CONFIG_COMPAT
  20. # define SECCOMP_ARCH_COMPAT AUDIT_ARCH_I386
  21. # define SECCOMP_ARCH_COMPAT_NR IA32_NR_syscalls
  22. # define SECCOMP_ARCH_COMPAT_NAME "ia32"
  23. # endif
  24. /*
  25. * x32 will have __X32_SYSCALL_BIT set in syscall number. We don't support
  26. * caching them and they are treated as out of range syscalls, which will
  27. * always pass through the BPF filter.
  28. */
  29. #else /* !CONFIG_X86_64 */
  30. # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_I386
  31. # define SECCOMP_ARCH_NATIVE_NR NR_syscalls
  32. # define SECCOMP_ARCH_NATIVE_NAME "ia32"
  33. #endif
  34. #include <asm-generic/seccomp.h>
  35. #endif /* _ASM_X86_SECCOMP_H */