1655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng/**************************************************************************** 2655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng **************************************************************************** 3655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 4655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** This header was automatically generated from a Linux kernel header 5655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** of the same name, to make information necessary for userspace to 6655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** call into the kernel available to libc. It contains only constants, 7655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** structures, and macros generated from the original header, and thus, 8655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** contains no copyrightable information. 9655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 10655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** To edit the content of this header, modify the corresponding 11655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** source file (e.g. under external/kernel-headers/original/) then 12655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** run bionic/libc/kernel/tools/update_all.py 13655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 14655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** Any manual change here will be lost the next time this script will 15655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** be run. You've been warned! 16655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 17655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng **************************************************************************** 18655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ****************************************************************************/ 19655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#ifndef _UAPI_LINUX_AUDIT_H_ 20655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define _UAPI_LINUX_AUDIT_H_ 21655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#include <linux/types.h> 22655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#include <linux/elf-em.h> 23655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_GET 1000 24655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_SET 1001 25655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_LIST 1002 26655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_ADD 1003 27655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_DEL 1004 28655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_USER 1005 29655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_LOGIN 1006 30655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_WATCH_INS 1007 31655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_WATCH_REM 1008 32655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_WATCH_LIST 1009 33655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_SIGNAL_INFO 1010 34655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_ADD_RULE 1011 35655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_DEL_RULE 1012 36655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_LIST_RULES 1013 37655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_TRIM 1014 38655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MAKE_EQUIV 1015 39655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_TTY_GET 1016 40655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_TTY_SET 1017 4138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define AUDIT_SET_FEATURE 1018 4238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define AUDIT_GET_FEATURE 1019 43655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_FIRST_USER_MSG 1100 44655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_USER_AVC 1107 45655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_USER_TTY 1124 46655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_LAST_USER_MSG 1199 47655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_FIRST_USER_MSG2 2100 48655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_LAST_USER_MSG2 2999 49655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_DAEMON_START 1200 50655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_DAEMON_END 1201 51655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_DAEMON_ABORT 1202 52655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_DAEMON_CONFIG 1203 53655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_SYSCALL 1300 54655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_PATH 1302 55655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_IPC 1303 56655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_SOCKETCALL 1304 57655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_CONFIG_CHANGE 1305 58655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_SOCKADDR 1306 59655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_CWD 1307 60655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_EXECVE 1309 61655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_IPC_SET_PERM 1311 62655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MQ_OPEN 1312 63655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MQ_SENDRECV 1313 64655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MQ_NOTIFY 1314 65655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MQ_GETSETATTR 1315 66655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_KERNEL_OTHER 1316 67655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_FD_PAIR 1317 68655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_OBJ_PID 1318 69655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_TTY 1319 70655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_EOE 1320 71655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_BPRM_FCAPS 1321 72655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_CAPSET 1322 73655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MMAP 1323 74655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_NETFILTER_PKT 1324 75655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_NETFILTER_CFG 1325 76655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_SECCOMP 1326 77ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_PROCTITLE 1327 78ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_FEATURE_CHANGE 1328 79106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_REPLACE 1329 80ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_AVC 1400 81655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_SELINUX_ERR 1401 82655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_AVC_PATH 1402 83106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_MAC_POLICY_LOAD 1403 84ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_MAC_STATUS 1404 85655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MAC_CONFIG_CHANGE 1405 86655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MAC_UNLBL_ALLOW 1406 87106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_MAC_CIPSOV4_ADD 1407 88ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_MAC_CIPSOV4_DEL 1408 89655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MAC_MAP_ADD 1409 90655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MAC_MAP_DEL 1410 91106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_MAC_IPSEC_ADDSA 1411 92ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_MAC_IPSEC_DELSA 1412 93655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MAC_IPSEC_ADDSPD 1413 94655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MAC_IPSEC_DELSPD 1414 95106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_MAC_IPSEC_EVENT 1415 96ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_MAC_UNLBL_STCADD 1416 97655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MAC_UNLBL_STCDEL 1417 9849f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris#define AUDIT_MAC_CALIPSO_ADD 1418 9949f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris#define AUDIT_MAC_CALIPSO_DEL 1419 10049f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris#define AUDIT_FIRST_KERN_ANOM_MSG 1700 101106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_LAST_KERN_ANOM_MSG 1799 102ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_ANOM_PROMISCUOUS 1700 103655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_ANOM_ABEND 1701 104655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_ANOM_LINK 1702 105106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_INTEGRITY_DATA 1800 106ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_INTEGRITY_METADATA 1801 107655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_INTEGRITY_STATUS 1802 108655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_INTEGRITY_HASH 1803 109106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_INTEGRITY_PCR 1804 110ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_INTEGRITY_RULE 1805 111655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_KERNEL 2000 112655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_FILTER_USER 0x00 113106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_FILTER_TASK 0x01 114ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_FILTER_ENTRY 0x02 115655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_FILTER_WATCH 0x03 116655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_FILTER_EXIT 0x04 117106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_FILTER_TYPE 0x05 118ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_NR_FILTERS 6 119655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_FILTER_PREPEND 0x10 120655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_NEVER 0 121106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_POSSIBLE 1 122ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_ALWAYS 2 123655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MAX_FIELDS 64 124655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_MAX_KEY_LEN 256 125106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_BITMASK_SIZE 64 126d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_WORD(nr) ((__u32) ((nr) / 32)) 127d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr) * 32)) 128655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_SYSCALL_CLASSES 16 129106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_CLASS_DIR_WRITE 0 130ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_CLASS_DIR_WRITE_32 1 131655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_CLASS_CHATTR 2 132655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_CLASS_CHATTR_32 3 133106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_CLASS_READ 4 134ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_CLASS_READ_32 5 135655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_CLASS_WRITE 6 136655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_CLASS_WRITE_32 7 137106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_CLASS_SIGNAL 8 138ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_CLASS_SIGNAL_32 9 139655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_UNUSED_BITS 0x07FFFC00 140655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_COMPARE_UID_TO_OBJ_UID 1 141106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_COMPARE_GID_TO_OBJ_GID 2 142ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_COMPARE_EUID_TO_OBJ_UID 3 143655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_COMPARE_EGID_TO_OBJ_GID 4 144655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_COMPARE_AUID_TO_OBJ_UID 5 145106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_COMPARE_SUID_TO_OBJ_UID 6 146ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_COMPARE_SGID_TO_OBJ_GID 7 147655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_COMPARE_FSUID_TO_OBJ_UID 8 148655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_COMPARE_FSGID_TO_OBJ_GID 9 149106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_COMPARE_UID_TO_AUID 10 150ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_COMPARE_UID_TO_EUID 11 151655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_COMPARE_UID_TO_FSUID 12 152655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_COMPARE_UID_TO_SUID 13 153106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_COMPARE_AUID_TO_FSUID 14 154ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_COMPARE_AUID_TO_SUID 15 155655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_COMPARE_AUID_TO_EUID 16 156655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_COMPARE_EUID_TO_SUID 17 157106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_COMPARE_EUID_TO_FSUID 18 158ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_COMPARE_SUID_TO_FSUID 19 159655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_COMPARE_GID_TO_EGID 20 160655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_COMPARE_GID_TO_FSGID 21 161106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_COMPARE_GID_TO_SGID 22 162ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_COMPARE_EGID_TO_FSGID 23 163655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_COMPARE_EGID_TO_SGID 24 164655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_COMPARE_SGID_TO_FSGID 25 165106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_MAX_FIELD_COMPARE AUDIT_COMPARE_SGID_TO_FSGID 166ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_PID 0 167655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_UID 1 168655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_EUID 2 169106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_SUID 3 170ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_FSUID 4 171655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_GID 5 172655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_EGID 6 173106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_SGID 7 174ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_FSGID 8 175655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_LOGINUID 9 176655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_PERS 10 177106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_ARCH 11 178ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_MSGTYPE 12 179655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_SUBJ_USER 13 180655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_SUBJ_ROLE 14 181106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_SUBJ_TYPE 15 182ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_SUBJ_SEN 16 183655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_SUBJ_CLR 17 184655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_PPID 18 185106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_OBJ_USER 19 186ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_OBJ_ROLE 20 187655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_OBJ_TYPE 21 188655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_OBJ_LEV_LOW 22 189106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_OBJ_LEV_HIGH 23 190ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_LOGINUID_SET 24 19148af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris#define AUDIT_SESSIONID 25 192655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_DEVMAJOR 100 193655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_DEVMINOR 101 194106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_INODE 102 19548af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris#define AUDIT_EXIT 103 196655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_SUCCESS 104 197655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_WATCH 105 198106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_PERM 106 19948af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris#define AUDIT_DIR 107 200655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_FILETYPE 108 201655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_OBJ_UID 109 202106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_OBJ_GID 110 20348af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris#define AUDIT_FIELD_COMPARE 111 20405d08e9716b5974d6ed08973f44930804890b902Christopher Ferris#define AUDIT_EXE 112 205655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_ARG0 200 206106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_ARG1 (AUDIT_ARG0 + 1) 20748af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris#define AUDIT_ARG2 (AUDIT_ARG0 + 2) 208d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_ARG3 (AUDIT_ARG0 + 3) 209655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_FILTERKEY 210 210106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_NEGATE 0x80000000 21148af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris#define AUDIT_BIT_MASK 0x08000000 212ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_LESS_THAN 0x10000000 213655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_GREATER_THAN 0x20000000 214106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_NOT_EQUAL 0x30000000 21548af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris#define AUDIT_EQUAL 0x40000000 216d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_BIT_TEST (AUDIT_BIT_MASK | AUDIT_EQUAL) 217d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN | AUDIT_EQUAL) 218106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN | AUDIT_EQUAL) 21948af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris#define AUDIT_OPERATORS (AUDIT_EQUAL | AUDIT_NOT_EQUAL | AUDIT_BIT_MASK) 220ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferrisenum { 221d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao Audit_equal, 222106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris Audit_not_equal, 22348af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris Audit_bitmask, 224d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao Audit_bittest, 225d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao Audit_lt, 226106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris Audit_gt, 22748af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris Audit_le, 228d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao Audit_ge, 229d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao Audit_bad 230106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris}; 23148af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris#define AUDIT_STATUS_ENABLED 0x0001 232ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_STATUS_FAILURE 0x0002 233655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_STATUS_PID 0x0004 234106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_STATUS_RATE_LIMIT 0x0008 23548af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris#define AUDIT_STATUS_BACKLOG_LIMIT 0x0010 236ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_STATUS_BACKLOG_WAIT_TIME 0x0020 23705d08e9716b5974d6ed08973f44930804890b902Christopher Ferris#define AUDIT_FEATURE_BITMAP_BACKLOG_LIMIT 0x00000001 238106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_FEATURE_BITMAP_BACKLOG_WAIT_TIME 0x00000002 23948af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris#define AUDIT_FEATURE_BITMAP_EXECUTABLE_PATH 0x00000004 2406a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define AUDIT_FEATURE_BITMAP_EXCLUDE_EXTEND 0x00000008 24148af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris#define AUDIT_FEATURE_BITMAP_SESSIONID_FILTER 0x00000010 24248af7cb2e205dcc2f09a1a1b8a1a37c93e1943f0Christopher Ferris#define AUDIT_FEATURE_BITMAP_ALL (AUDIT_FEATURE_BITMAP_BACKLOG_LIMIT | AUDIT_FEATURE_BITMAP_BACKLOG_WAIT_TIME | AUDIT_FEATURE_BITMAP_EXECUTABLE_PATH | AUDIT_FEATURE_BITMAP_EXCLUDE_EXTEND | AUDIT_FEATURE_BITMAP_SESSIONID_FILTER) 24305d08e9716b5974d6ed08973f44930804890b902Christopher Ferris#define AUDIT_VERSION_LATEST AUDIT_FEATURE_BITMAP_ALL 244106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_VERSION_BACKLOG_LIMIT AUDIT_FEATURE_BITMAP_BACKLOG_LIMIT 2456a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define AUDIT_VERSION_BACKLOG_WAIT_TIME AUDIT_FEATURE_BITMAP_BACKLOG_WAIT_TIME 246ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_FAIL_SILENT 0 247655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_FAIL_PRINTK 1 248106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_FAIL_PANIC 2 2496a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define __AUDIT_ARCH_CONVENTION_MASK 0x30000000 250ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define __AUDIT_ARCH_CONVENTION_MIPS64_N32 0x20000000 251655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define __AUDIT_ARCH_64BIT 0x80000000 252106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define __AUDIT_ARCH_LE 0x40000000 2536a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define AUDIT_ARCH_AARCH64 (EM_AARCH64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE) 254d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_ARCH_ALPHA (EM_ALPHA | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE) 255d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_ARCH_ARM (EM_ARM | __AUDIT_ARCH_LE) 256106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_ARCH_ARMEB (EM_ARM) 2576a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define AUDIT_ARCH_CRIS (EM_CRIS | __AUDIT_ARCH_LE) 25882d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris#define AUDIT_ARCH_FRV (EM_FRV) 259d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_ARCH_I386 (EM_386 | __AUDIT_ARCH_LE) 260106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_ARCH_IA64 (EM_IA_64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE) 2616a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define AUDIT_ARCH_M32R (EM_M32R) 26282d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris#define AUDIT_ARCH_M68K (EM_68K) 26382d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris#define AUDIT_ARCH_MICROBLAZE (EM_MICROBLAZE) 264106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_ARCH_MIPS (EM_MIPS) 2656a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define AUDIT_ARCH_MIPSEL (EM_MIPS | __AUDIT_ARCH_LE) 266d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_ARCH_MIPS64 (EM_MIPS | __AUDIT_ARCH_64BIT) 267d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_ARCH_MIPS64N32 (EM_MIPS | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_CONVENTION_MIPS64_N32) 268106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_ARCH_MIPSEL64 (EM_MIPS | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE) 2696a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define AUDIT_ARCH_MIPSEL64N32 (EM_MIPS | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE | __AUDIT_ARCH_CONVENTION_MIPS64_N32) 270655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_ARCH_OPENRISC (EM_OPENRISC) 271655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_ARCH_PARISC (EM_PARISC) 272106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_ARCH_PARISC64 (EM_PARISC | __AUDIT_ARCH_64BIT) 2736a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define AUDIT_ARCH_PPC (EM_PPC) 274d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_ARCH_PPC64 (EM_PPC64 | __AUDIT_ARCH_64BIT) 275d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_ARCH_PPC64LE (EM_PPC64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE) 276106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_ARCH_S390 (EM_S390) 2776a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define AUDIT_ARCH_S390X (EM_S390 | __AUDIT_ARCH_64BIT) 278655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_ARCH_SH (EM_SH) 279d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_ARCH_SHEL (EM_SH | __AUDIT_ARCH_LE) 280106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_ARCH_SH64 (EM_SH | __AUDIT_ARCH_64BIT) 2816a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define AUDIT_ARCH_SHEL64 (EM_SH | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE) 282655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_ARCH_SPARC (EM_SPARC) 283d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_ARCH_SPARC64 (EM_SPARCV9 | __AUDIT_ARCH_64BIT) 284106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_ARCH_TILEGX (EM_TILEGX | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE) 2856a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define AUDIT_ARCH_TILEGX32 (EM_TILEGX | __AUDIT_ARCH_LE) 28605d08e9716b5974d6ed08973f44930804890b902Christopher Ferris#define AUDIT_ARCH_TILEPRO (EM_TILEPRO | __AUDIT_ARCH_LE) 287d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_ARCH_X86_64 (EM_X86_64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE) 288106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_PERM_EXEC 1 2896a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define AUDIT_PERM_WRITE 2 290655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_PERM_READ 4 291655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define AUDIT_PERM_ATTR 8 292106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define AUDIT_MESSAGE_TEXT_MAX 8560 2936a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferrisenum audit_nlgrps { 294d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao AUDIT_NLGRP_NONE, 295d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao AUDIT_NLGRP_READLOG, 296106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris __AUDIT_NLGRP_MAX 2976a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris}; 298ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define AUDIT_NLGRP_MAX (__AUDIT_NLGRP_MAX - 1) 299655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct audit_status { 300106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris __u32 mask; 3016a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris __u32 enabled; 302d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 failure; 303d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 pid; 304106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris __u32 rate_limit; 3056a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris __u32 backlog_limit; 306d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 lost; 307d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 backlog; 308106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris union { 3096a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris __u32 version; 31005d08e9716b5974d6ed08973f44930804890b902Christopher Ferris __u32 feature_bitmap; 31105d08e9716b5974d6ed08973f44930804890b902Christopher Ferris }; 312106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris __u32 backlog_wait_time; 3136a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris}; 31438062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct audit_features { 31538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define AUDIT_FEATURE_VERSION 1 316106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris __u32 vers; 3176a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris __u32 mask; 318d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 features; 319d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 lock; 320106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris}; 3216a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define AUDIT_FEATURE_ONLY_UNSET_LOGINUID 0 32238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define AUDIT_FEATURE_LOGINUID_IMMUTABLE 1 32338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define AUDIT_LAST_FEATURE AUDIT_FEATURE_LOGINUID_IMMUTABLE 324106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define audit_feature_valid(x) ((x) >= 0 && (x) <= AUDIT_LAST_FEATURE) 3256a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define AUDIT_FEATURE_TO_MASK(x) (1 << ((x) & 31)) 32638062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct audit_tty_status { 327d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 enabled; 328106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris __u32 log_passwd; 3296a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris}; 330d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define AUDIT_UID_UNSET (unsigned int) - 1 33138062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct audit_rule_data { 332106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris __u32 flags; 3336a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris __u32 action; 334d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 field_count; 335d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 mask[AUDIT_BITMASK_SIZE]; 336106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris __u32 fields[AUDIT_MAX_FIELDS]; 3376a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris __u32 values[AUDIT_MAX_FIELDS]; 338d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 fieldflags[AUDIT_MAX_FIELDS]; 339d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 buflen; 340106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris char buf[0]; 3416a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris}; 342655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#endif 343