1 #define COMMON_FILE_SOCK_PERMS "ioctl", "read", "write", "create", \
2 "getattr", "setattr", "lock", "relabelfrom", "relabelto", "append"
4 #define COMMON_FILE_PERMS COMMON_FILE_SOCK_PERMS, "unlink", "link", \
5 "rename", "execute", "quotaon", "mounton", "audit_access", \
8 #define COMMON_SOCK_PERMS COMMON_FILE_SOCK_PERMS, "bind", "connect", \
9 "listen", "accept", "getopt", "setopt", "shutdown", "recvfrom", \
12 #define COMMON_IPC_PERMS "create", "destroy", "getattr", "setattr", "read", \
13 "write", "associate", "unix_read", "unix_write"
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"
24 #define COMMON_CAP2_PERMS "mac_override", "mac_admin", "syslog", \
25 "wake_alarm", "block_suspend", "audit_read"
28 * Note: The name for any socket class should be suffixed by "socket",
29 * and doesn't contain more than one substr of "socket".
31 struct security_class_mapping secclass_map
[] = {
33 { "compute_av", "compute_create", "compute_member",
34 "check_context", "load_policy", "compute_relabel",
35 "compute_user", "setenforce", "setbool", "setsecparam",
36 "setcheckreqprot", "read_policy", "validate_trans", NULL
} },
38 { "fork", "transition", "sigchld", "sigkill",
39 "sigstop", "signull", "signal", "ptrace", "getsched", "setsched",
40 "getsession", "getpgid", "setpgid", "getcap", "setcap", "share",
41 "getattr", "setexec", "setfscreate", "noatsecure", "siginh",
42 "setrlimit", "rlimitinh", "dyntransition", "setcurrent",
43 "execmem", "execstack", "execheap", "setkeycreate",
44 "setsockcreate", NULL
} },
46 { "ipc_info", "syslog_read", "syslog_mod",
47 "syslog_console", "module_request", "module_load", NULL
} },
49 { COMMON_CAP_PERMS
, NULL
} },
51 { "mount", "remount", "unmount", "getattr",
52 "relabelfrom", "relabelto", "associate", "quotamod",
56 "execute_no_trans", "entrypoint", NULL
} },
58 { COMMON_FILE_PERMS
, "add_name", "remove_name",
59 "reparent", "search", "rmdir", NULL
} },
60 { "fd", { "use", NULL
} },
62 { COMMON_FILE_PERMS
, NULL
} },
64 { COMMON_FILE_PERMS
, NULL
} },
66 { COMMON_FILE_PERMS
, NULL
} },
68 { COMMON_FILE_PERMS
, NULL
} },
70 { COMMON_FILE_PERMS
, NULL
} },
72 { COMMON_SOCK_PERMS
, NULL
} },
75 "node_bind", "name_connect",
79 "node_bind", NULL
} },
82 "node_bind", NULL
} },
84 { "recvfrom", "sendto", NULL
} },
86 { "ingress", "egress", NULL
} },
88 { COMMON_SOCK_PERMS
, NULL
} },
90 { COMMON_SOCK_PERMS
, NULL
} },
92 { COMMON_SOCK_PERMS
, NULL
} },
93 { "unix_stream_socket",
94 { COMMON_SOCK_PERMS
, "connectto", NULL
} },
95 { "unix_dgram_socket",
96 { COMMON_SOCK_PERMS
, NULL
} },
98 { COMMON_IPC_PERMS
, NULL
} },
99 { "msg", { "send", "receive", NULL
} },
101 { COMMON_IPC_PERMS
, "enqueue", NULL
} },
103 { COMMON_IPC_PERMS
, "lock", NULL
} },
105 { COMMON_IPC_PERMS
, NULL
} },
106 { "netlink_route_socket",
108 "nlmsg_read", "nlmsg_write", NULL
} },
109 { "netlink_tcpdiag_socket",
111 "nlmsg_read", "nlmsg_write", NULL
} },
112 { "netlink_nflog_socket",
113 { COMMON_SOCK_PERMS
, NULL
} },
114 { "netlink_xfrm_socket",
116 "nlmsg_read", "nlmsg_write", NULL
} },
117 { "netlink_selinux_socket",
118 { COMMON_SOCK_PERMS
, NULL
} },
119 { "netlink_iscsi_socket",
120 { COMMON_SOCK_PERMS
, NULL
} },
121 { "netlink_audit_socket",
123 "nlmsg_read", "nlmsg_write", "nlmsg_relay", "nlmsg_readpriv",
124 "nlmsg_tty_audit", NULL
} },
125 { "netlink_fib_lookup_socket",
126 { COMMON_SOCK_PERMS
, NULL
} },
127 { "netlink_connector_socket",
128 { COMMON_SOCK_PERMS
, NULL
} },
129 { "netlink_netfilter_socket",
130 { COMMON_SOCK_PERMS
, NULL
} },
131 { "netlink_dnrt_socket",
132 { COMMON_SOCK_PERMS
, NULL
} },
134 { "sendto", "recvfrom", "setcontext", "polmatch", NULL
} },
135 { "netlink_kobject_uevent_socket",
136 { COMMON_SOCK_PERMS
, NULL
} },
137 { "netlink_generic_socket",
138 { COMMON_SOCK_PERMS
, NULL
} },
139 { "netlink_scsitransport_socket",
140 { COMMON_SOCK_PERMS
, NULL
} },
141 { "netlink_rdma_socket",
142 { COMMON_SOCK_PERMS
, NULL
} },
143 { "netlink_crypto_socket",
144 { COMMON_SOCK_PERMS
, NULL
} },
145 { "appletalk_socket",
146 { COMMON_SOCK_PERMS
, NULL
} },
148 { "send", "recv", "relabelto", "forward_in", "forward_out", NULL
} },
150 { "view", "read", "write", "search", "link", "setattr", "create",
154 "node_bind", "name_connect", NULL
} },
155 { "memprotect", { "mmap_zero", NULL
} },
156 { "peer", { "recv", NULL
} },
158 { COMMON_CAP2_PERMS
, NULL
} },
159 { "kernel_service", { "use_as_override", "create_files_as", NULL
} },
161 { COMMON_SOCK_PERMS
, "attach_queue", NULL
} },
162 { "binder", { "impersonate", "call", "set_context_mgr", "transfer",
165 { COMMON_CAP_PERMS
, NULL
} },
167 { COMMON_CAP2_PERMS
, NULL
} },