compat_audit.c 796 B

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