Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 #include <linux/init.h>
0003 #include <linux/types.h>
0004 #include <linux/audit_arch.h>
0005 #include <asm/unistd32.h>
0006 
0007 unsigned compat_dir_class[] = {
0008 #include <asm-generic/audit_dir_write.h>
0009 ~0U
0010 };
0011 
0012 unsigned compat_read_class[] = {
0013 #include <asm-generic/audit_read.h>
0014 ~0U
0015 };
0016 
0017 unsigned compat_write_class[] = {
0018 #include <asm-generic/audit_write.h>
0019 ~0U
0020 };
0021 
0022 unsigned compat_chattr_class[] = {
0023 #include <asm-generic/audit_change_attr.h>
0024 ~0U
0025 };
0026 
0027 unsigned compat_signal_class[] = {
0028 #include <asm-generic/audit_signal.h>
0029 ~0U
0030 };
0031 
0032 int audit_classify_compat_syscall(int abi, unsigned syscall)
0033 {
0034     switch (syscall) {
0035 #ifdef __NR_open
0036     case __NR_open:
0037         return AUDITSC_OPEN;
0038 #endif
0039 #ifdef __NR_openat
0040     case __NR_openat:
0041         return AUDITSC_OPENAT;
0042 #endif
0043 #ifdef __NR_socketcall
0044     case __NR_socketcall:
0045         return AUDITSC_SOCKETCALL;
0046 #endif
0047     case __NR_execve:
0048         return AUDITSC_EXECVE;
0049 #ifdef __NR_openat2
0050     case __NR_openat2:
0051         return AUDITSC_OPENAT2;
0052 #endif
0053     default:
0054         return AUDITSC_COMPAT;
0055     }
0056 }