compat_audit.c 832 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/init.h>
  3. #include <linux/types.h>
  4. #include <asm/unistd32.h>
  5. unsigned compat_dir_class[] = {
  6. #include <asm-generic/audit_dir_write.h>
  7. ~0U
  8. };
  9. unsigned compat_read_class[] = {
  10. #include <asm-generic/audit_read.h>
  11. ~0U
  12. };
  13. unsigned compat_write_class[] = {
  14. #include <asm-generic/audit_write.h>
  15. ~0U
  16. };
  17. unsigned compat_chattr_class[] = {
  18. #include <asm-generic/audit_change_attr.h>
  19. ~0U
  20. };
  21. unsigned compat_signal_class[] = {
  22. #include <asm-generic/audit_signal.h>
  23. ~0U
  24. };
  25. int audit_classify_compat_syscall(int abi, unsigned syscall)
  26. {
  27. switch (syscall) {
  28. #ifdef __NR_open
  29. case __NR_open:
  30. return 2;
  31. #endif
  32. #ifdef __NR_openat
  33. case __NR_openat:
  34. return 3;
  35. #endif
  36. #ifdef __NR_socketcall
  37. case __NR_socketcall:
  38. return 4;
  39. #endif
  40. case __NR_execve:
  41. return 5;
  42. default:
  43. return 1;
  44. }
  45. }