1 #define COMMON_FILE_SOCK_PERMS "ioctl", "read", "write", "create", \ 2 "getattr", "setattr", "lock", "relabelfrom", "relabelto", "append" 3 4 #define COMMON_FILE_PERMS COMMON_FILE_SOCK_PERMS, "unlink", "link", \ 5 "rename", "execute", "quotaon", "mounton", "audit_access", \ 6 "open", "execmod" 7 8 #define COMMON_SOCK_PERMS COMMON_FILE_SOCK_PERMS, "bind", "connect", \ 9 "listen", "accept", "getopt", "setopt", "shutdown", "recvfrom", \ 10 "sendto", "name_bind" 11 12 #define COMMON_IPC_PERMS "create", "destroy", "getattr", "setattr", "read", \ 13 "write", "associate", "unix_read", "unix_write" 14 15 #define COMMON_CAP_PERMS "chown", "dac_override", "dac_read_search", \ 16 "fowner", "fsetid", "kill", "setgid", "setuid", "setpcap", \ 17 "linux_immutable", "net_bind_service", "net_broadcast", \ 18 "net_admin", "net_raw", "ipc_lock", "ipc_owner", "sys_module", \ 19 "sys_rawio", "sys_chroot", "sys_ptrace", "sys_pacct", "sys_admin", \ 20 "sys_boot", "sys_nice", "sys_resource", "sys_time", \ 21 "sys_tty_config", "mknod", "lease", "audit_write", \ 22 "audit_control", "setfcap" 23 24 #define COMMON_CAP2_PERMS "mac_override", "mac_admin", "syslog", \ 25 "wake_alarm", "block_suspend", "audit_read" 26 27 #if CAP_LAST_CAP > CAP_AUDIT_READ 28 #error New capability defined, please update COMMON_CAP2_PERMS. 29 #endif 30 31 /* 32 * Note: The name for any socket class should be suffixed by "socket", 33 * and doesn't contain more than one substr of "socket". 34 */ 35 struct security_class_mapping secclass_map[] = { 36 { "security", 37 { "compute_av", "compute_create", "compute_member", 38 "check_context", "load_policy", "compute_relabel", 39 "compute_user", "setenforce", "setbool", "setsecparam", 40 "setcheckreqprot", "read_policy", "validate_trans", NULL } }, 41 { "process", 42 { "fork", "transition", "sigchld", "sigkill", 43 "sigstop", "signull", "signal", "ptrace", "getsched", "setsched", 44 "getsession", "getpgid", "setpgid", "getcap", "setcap", "share", 45 "getattr", "setexec", "setfscreate", "noatsecure", "siginh", 46 "setrlimit", "rlimitinh", "dyntransition", "setcurrent", 47 "execmem", "execstack", "execheap", "setkeycreate", 48 "setsockcreate", NULL } }, 49 { "system", 50 { "ipc_info", "syslog_read", "syslog_mod", 51 "syslog_console", "module_request", "module_load", NULL } }, 52 { "capability", 53 { COMMON_CAP_PERMS, NULL } }, 54 { "filesystem", 55 { "mount", "remount", "unmount", "getattr", 56 "relabelfrom", "relabelto", "associate", "quotamod", 57 "quotaget", NULL } }, 58 { "file", 59 { COMMON_FILE_PERMS, 60 "execute_no_trans", "entrypoint", NULL } }, 61 { "dir", 62 { COMMON_FILE_PERMS, "add_name", "remove_name", 63 "reparent", "search", "rmdir", NULL } }, 64 { "fd", { "use", NULL } }, 65 { "lnk_file", 66 { COMMON_FILE_PERMS, NULL } }, 67 { "chr_file", 68 { COMMON_FILE_PERMS, NULL } }, 69 { "blk_file", 70 { COMMON_FILE_PERMS, NULL } }, 71 { "sock_file", 72 { COMMON_FILE_PERMS, NULL } }, 73 { "fifo_file", 74 { COMMON_FILE_PERMS, NULL } }, 75 { "socket", 76 { COMMON_SOCK_PERMS, NULL } }, 77 { "tcp_socket", 78 { COMMON_SOCK_PERMS, 79 "node_bind", "name_connect", 80 NULL } }, 81 { "udp_socket", 82 { COMMON_SOCK_PERMS, 83 "node_bind", NULL } }, 84 { "rawip_socket", 85 { COMMON_SOCK_PERMS, 86 "node_bind", NULL } }, 87 { "node", 88 { "recvfrom", "sendto", NULL } }, 89 { "netif", 90 { "ingress", "egress", NULL } }, 91 { "netlink_socket", 92 { COMMON_SOCK_PERMS, NULL } }, 93 { "packet_socket", 94 { COMMON_SOCK_PERMS, NULL } }, 95 { "key_socket", 96 { COMMON_SOCK_PERMS, NULL } }, 97 { "unix_stream_socket", 98 { COMMON_SOCK_PERMS, "connectto", NULL } }, 99 { "unix_dgram_socket", 100 { COMMON_SOCK_PERMS, NULL } }, 101 { "sem", 102 { COMMON_IPC_PERMS, NULL } }, 103 { "msg", { "send", "receive", NULL } }, 104 { "msgq", 105 { COMMON_IPC_PERMS, "enqueue", NULL } }, 106 { "shm", 107 { COMMON_IPC_PERMS, "lock", NULL } }, 108 { "ipc", 109 { COMMON_IPC_PERMS, NULL } }, 110 { "netlink_route_socket", 111 { COMMON_SOCK_PERMS, 112 "nlmsg_read", "nlmsg_write", NULL } }, 113 { "netlink_tcpdiag_socket", 114 { COMMON_SOCK_PERMS, 115 "nlmsg_read", "nlmsg_write", NULL } }, 116 { "netlink_nflog_socket", 117 { COMMON_SOCK_PERMS, NULL } }, 118 { "netlink_xfrm_socket", 119 { COMMON_SOCK_PERMS, 120 "nlmsg_read", "nlmsg_write", NULL } }, 121 { "netlink_selinux_socket", 122 { COMMON_SOCK_PERMS, NULL } }, 123 { "netlink_iscsi_socket", 124 { COMMON_SOCK_PERMS, NULL } }, 125 { "netlink_audit_socket", 126 { COMMON_SOCK_PERMS, 127 "nlmsg_read", "nlmsg_write", "nlmsg_relay", "nlmsg_readpriv", 128 "nlmsg_tty_audit", NULL } }, 129 { "netlink_fib_lookup_socket", 130 { COMMON_SOCK_PERMS, NULL } }, 131 { "netlink_connector_socket", 132 { COMMON_SOCK_PERMS, NULL } }, 133 { "netlink_netfilter_socket", 134 { COMMON_SOCK_PERMS, NULL } }, 135 { "netlink_dnrt_socket", 136 { COMMON_SOCK_PERMS, NULL } }, 137 { "association", 138 { "sendto", "recvfrom", "setcontext", "polmatch", NULL } }, 139 { "netlink_kobject_uevent_socket", 140 { COMMON_SOCK_PERMS, NULL } }, 141 { "netlink_generic_socket", 142 { COMMON_SOCK_PERMS, NULL } }, 143 { "netlink_scsitransport_socket", 144 { COMMON_SOCK_PERMS, NULL } }, 145 { "netlink_rdma_socket", 146 { COMMON_SOCK_PERMS, NULL } }, 147 { "netlink_crypto_socket", 148 { COMMON_SOCK_PERMS, NULL } }, 149 { "appletalk_socket", 150 { COMMON_SOCK_PERMS, NULL } }, 151 { "packet", 152 { "send", "recv", "relabelto", "forward_in", "forward_out", NULL } }, 153 { "key", 154 { "view", "read", "write", "search", "link", "setattr", "create", 155 NULL } }, 156 { "dccp_socket", 157 { COMMON_SOCK_PERMS, 158 "node_bind", "name_connect", NULL } }, 159 { "memprotect", { "mmap_zero", NULL } }, 160 { "peer", { "recv", NULL } }, 161 { "capability2", 162 { COMMON_CAP2_PERMS, NULL } }, 163 { "kernel_service", { "use_as_override", "create_files_as", NULL } }, 164 { "tun_socket", 165 { COMMON_SOCK_PERMS, "attach_queue", NULL } }, 166 { "binder", { "impersonate", "call", "set_context_mgr", "transfer", 167 NULL } }, 168 { "cap_userns", 169 { COMMON_CAP_PERMS, NULL } }, 170 { "cap2_userns", 171 { COMMON_CAP2_PERMS, NULL } }, 172 { NULL } 173 }; 174