1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0 2b915543bSAl Viro #include <linux/init.h> 3b915543bSAl Viro #include <linux/types.h> 4b915543bSAl Viro #include <linux/audit.h> 5b915543bSAl Viro #include <asm/unistd.h> 6b915543bSAl Viro 7b915543bSAl Viro static unsigned dir_class[] = { 8b915543bSAl Viro #include <asm-generic/audit_dir_write.h> 9b915543bSAl Viro ~0U 10b915543bSAl Viro }; 11b915543bSAl Viro 12dc104fb3SAl Viro static unsigned read_class[] = { 13dc104fb3SAl Viro #include <asm-generic/audit_read.h> 14dc104fb3SAl Viro ~0U 15dc104fb3SAl Viro }; 16dc104fb3SAl Viro 17dc104fb3SAl Viro static unsigned write_class[] = { 18dc104fb3SAl Viro #include <asm-generic/audit_write.h> 19dc104fb3SAl Viro ~0U 20dc104fb3SAl Viro }; 21dc104fb3SAl Viro 22b915543bSAl Viro static unsigned chattr_class[] = { 23b915543bSAl Viro #include <asm-generic/audit_change_attr.h> 24b915543bSAl Viro ~0U 25b915543bSAl Viro }; 26b915543bSAl Viro 277f13da40SAmy Griffis static unsigned signal_class[] = { 287f13da40SAmy Griffis #include <asm-generic/audit_signal.h> 297f13da40SAmy Griffis ~0U 307f13da40SAmy Griffis }; 317f13da40SAmy Griffis audit_classify_arch(int arch)32e54dc243SAmy Griffisint audit_classify_arch(int arch) 33e54dc243SAmy Griffis { 34e54dc243SAmy Griffis return 0; 35e54dc243SAmy Griffis } 36e54dc243SAmy Griffis audit_classify_syscall(int abi,unsigned syscall)3755669bfaSAl Viroint audit_classify_syscall(int abi, unsigned syscall) 3855669bfaSAl Viro { 3955669bfaSAl Viro switch(syscall) { 4055669bfaSAl Viro case __NR_open: 4142f355efSRichard Guy Briggs return AUDITSC_OPEN; 4255669bfaSAl Viro case __NR_openat: 4342f355efSRichard Guy Briggs return AUDITSC_OPENAT; 4455669bfaSAl Viro case __NR_execve: 4542f355efSRichard Guy Briggs return AUDITSC_EXECVE; 46*1c30e3afSRichard Guy Briggs case __NR_openat2: 47*1c30e3afSRichard Guy Briggs return AUDITSC_OPENAT2; 4855669bfaSAl Viro default: 4942f355efSRichard Guy Briggs return AUDITSC_NATIVE; 5055669bfaSAl Viro } 5155669bfaSAl Viro } 5255669bfaSAl Viro audit_classes_init(void)53b915543bSAl Virostatic int __init audit_classes_init(void) 54b915543bSAl Viro { 55dc104fb3SAl Viro audit_register_class(AUDIT_CLASS_WRITE, write_class); 56dc104fb3SAl Viro audit_register_class(AUDIT_CLASS_READ, read_class); 57b915543bSAl Viro audit_register_class(AUDIT_CLASS_DIR_WRITE, dir_class); 58b915543bSAl Viro audit_register_class(AUDIT_CLASS_CHATTR, chattr_class); 597f13da40SAmy Griffis audit_register_class(AUDIT_CLASS_SIGNAL, signal_class); 60b915543bSAl Viro return 0; 61b915543bSAl Viro } 62b915543bSAl Viro 63b915543bSAl Viro __initcall(audit_classes_init); 64