1c6d3aaa4SStephen Smalley #define COMMON_FILE_SOCK_PERMS "ioctl", "read", "write", "create", \
2c6d3aaa4SStephen Smalley     "getattr", "setattr", "lock", "relabelfrom", "relabelto", "append"
3c6d3aaa4SStephen Smalley 
4c6d3aaa4SStephen Smalley #define COMMON_FILE_PERMS COMMON_FILE_SOCK_PERMS, "unlink", "link", \
5c6d3aaa4SStephen Smalley     "rename", "execute", "swapon", "quotaon", "mounton"
6c6d3aaa4SStephen Smalley 
7c6d3aaa4SStephen Smalley #define COMMON_SOCK_PERMS COMMON_FILE_SOCK_PERMS, "bind", "connect", \
8c6d3aaa4SStephen Smalley     "listen", "accept", "getopt", "setopt", "shutdown", "recvfrom",  \
9c6d3aaa4SStephen Smalley     "sendto", "recv_msg", "send_msg", "name_bind"
10c6d3aaa4SStephen Smalley 
11c6d3aaa4SStephen Smalley #define COMMON_IPC_PERMS "create", "destroy", "getattr", "setattr", "read", \
12c6d3aaa4SStephen Smalley 	    "write", "associate", "unix_read", "unix_write"
13c6d3aaa4SStephen Smalley 
14c6d3aaa4SStephen Smalley struct security_class_mapping secclass_map[] = {
15c6d3aaa4SStephen Smalley 	{ "security",
16c6d3aaa4SStephen Smalley 	  { "compute_av", "compute_create", "compute_member",
17c6d3aaa4SStephen Smalley 	    "check_context", "load_policy", "compute_relabel",
18c6d3aaa4SStephen Smalley 	    "compute_user", "setenforce", "setbool", "setsecparam",
19c6d3aaa4SStephen Smalley 	    "setcheckreqprot", NULL } },
20c6d3aaa4SStephen Smalley 	{ "process",
21c6d3aaa4SStephen Smalley 	  { "fork", "transition", "sigchld", "sigkill",
22c6d3aaa4SStephen Smalley 	    "sigstop", "signull", "signal", "ptrace", "getsched", "setsched",
23c6d3aaa4SStephen Smalley 	    "getsession", "getpgid", "setpgid", "getcap", "setcap", "share",
24c6d3aaa4SStephen Smalley 	    "getattr", "setexec", "setfscreate", "noatsecure", "siginh",
25c6d3aaa4SStephen Smalley 	    "setrlimit", "rlimitinh", "dyntransition", "setcurrent",
26c6d3aaa4SStephen Smalley 	    "execmem", "execstack", "execheap", "setkeycreate",
27c6d3aaa4SStephen Smalley 	    "setsockcreate", NULL } },
28c6d3aaa4SStephen Smalley 	{ "system",
29c6d3aaa4SStephen Smalley 	  { "ipc_info", "syslog_read", "syslog_mod",
30c6d3aaa4SStephen Smalley 	    "syslog_console", "module_request", NULL } },
31c6d3aaa4SStephen Smalley 	{ "capability",
32c6d3aaa4SStephen Smalley 	  { "chown", "dac_override", "dac_read_search",
33c6d3aaa4SStephen Smalley 	    "fowner", "fsetid", "kill", "setgid", "setuid", "setpcap",
34c6d3aaa4SStephen Smalley 	    "linux_immutable", "net_bind_service", "net_broadcast",
35c6d3aaa4SStephen Smalley 	    "net_admin", "net_raw", "ipc_lock", "ipc_owner", "sys_module",
36c6d3aaa4SStephen Smalley 	    "sys_rawio", "sys_chroot", "sys_ptrace", "sys_pacct", "sys_admin",
37c6d3aaa4SStephen Smalley 	    "sys_boot", "sys_nice", "sys_resource", "sys_time",
38c6d3aaa4SStephen Smalley 	    "sys_tty_config", "mknod", "lease", "audit_write",
39c6d3aaa4SStephen Smalley 	    "audit_control", "setfcap", NULL } },
40c6d3aaa4SStephen Smalley 	{ "filesystem",
41c6d3aaa4SStephen Smalley 	  { "mount", "remount", "unmount", "getattr",
42c6d3aaa4SStephen Smalley 	    "relabelfrom", "relabelto", "transition", "associate", "quotamod",
43c6d3aaa4SStephen Smalley 	    "quotaget", NULL } },
44c6d3aaa4SStephen Smalley 	{ "file",
45c6d3aaa4SStephen Smalley 	  { COMMON_FILE_PERMS,
46c6d3aaa4SStephen Smalley 	    "execute_no_trans", "entrypoint", "execmod", "open", NULL } },
47c6d3aaa4SStephen Smalley 	{ "dir",
48c6d3aaa4SStephen Smalley 	  { COMMON_FILE_PERMS, "add_name", "remove_name",
49c6d3aaa4SStephen Smalley 	    "reparent", "search", "rmdir", "open", NULL } },
50c6d3aaa4SStephen Smalley 	{ "fd", { "use", NULL } },
51c6d3aaa4SStephen Smalley 	{ "lnk_file",
52c6d3aaa4SStephen Smalley 	  { COMMON_FILE_PERMS, NULL } },
53c6d3aaa4SStephen Smalley 	{ "chr_file",
54c6d3aaa4SStephen Smalley 	  { COMMON_FILE_PERMS,
55c6d3aaa4SStephen Smalley 	    "execute_no_trans", "entrypoint", "execmod", "open", NULL } },
56c6d3aaa4SStephen Smalley 	{ "blk_file",
57c6d3aaa4SStephen Smalley 	  { COMMON_FILE_PERMS, "open", NULL } },
58c6d3aaa4SStephen Smalley 	{ "sock_file",
59c6d3aaa4SStephen Smalley 	  { COMMON_FILE_PERMS, "open", NULL } },
60c6d3aaa4SStephen Smalley 	{ "fifo_file",
61c6d3aaa4SStephen Smalley 	  { COMMON_FILE_PERMS, "open", NULL } },
62c6d3aaa4SStephen Smalley 	{ "socket",
63c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS, NULL } },
64c6d3aaa4SStephen Smalley 	{ "tcp_socket",
65c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS,
66c6d3aaa4SStephen Smalley 	    "connectto", "newconn", "acceptfrom", "node_bind", "name_connect",
67c6d3aaa4SStephen Smalley 	    NULL } },
68c6d3aaa4SStephen Smalley 	{ "udp_socket",
69c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS,
70c6d3aaa4SStephen Smalley 	    "node_bind", NULL } },
71c6d3aaa4SStephen Smalley 	{ "rawip_socket",
72c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS,
73c6d3aaa4SStephen Smalley 	    "node_bind", NULL } },
74c6d3aaa4SStephen Smalley 	{ "node",
75c6d3aaa4SStephen Smalley 	  { "tcp_recv", "tcp_send", "udp_recv", "udp_send",
76c6d3aaa4SStephen Smalley 	    "rawip_recv", "rawip_send", "enforce_dest",
77c6d3aaa4SStephen Smalley 	    "dccp_recv", "dccp_send", "recvfrom", "sendto", NULL } },
78c6d3aaa4SStephen Smalley 	{ "netif",
79c6d3aaa4SStephen Smalley 	  {  "tcp_recv", "tcp_send", "udp_recv", "udp_send",
80c6d3aaa4SStephen Smalley 	     "rawip_recv", "rawip_send", "dccp_recv", "dccp_send",
81c6d3aaa4SStephen Smalley 	     "ingress", "egress", NULL } },
82c6d3aaa4SStephen Smalley 	{ "netlink_socket",
83c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS, NULL } },
84c6d3aaa4SStephen Smalley 	{ "packet_socket",
85c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS, NULL } },
86c6d3aaa4SStephen Smalley 	{ "key_socket",
87c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS, NULL } },
88c6d3aaa4SStephen Smalley 	{ "unix_stream_socket",
89c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS, "connectto", "newconn", "acceptfrom", NULL
90c6d3aaa4SStephen Smalley 	  } },
91c6d3aaa4SStephen Smalley 	{ "unix_dgram_socket",
92c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS, NULL
93c6d3aaa4SStephen Smalley 	  } },
94c6d3aaa4SStephen Smalley 	{ "sem",
95c6d3aaa4SStephen Smalley 	  { COMMON_IPC_PERMS, NULL } },
96c6d3aaa4SStephen Smalley 	{ "msg", { "send", "receive", NULL } },
97c6d3aaa4SStephen Smalley 	{ "msgq",
98c6d3aaa4SStephen Smalley 	  { COMMON_IPC_PERMS, "enqueue", NULL } },
99c6d3aaa4SStephen Smalley 	{ "shm",
100c6d3aaa4SStephen Smalley 	  { COMMON_IPC_PERMS, "lock", NULL } },
101c6d3aaa4SStephen Smalley 	{ "ipc",
102c6d3aaa4SStephen Smalley 	  { COMMON_IPC_PERMS, NULL } },
103c6d3aaa4SStephen Smalley 	{ "netlink_route_socket",
104c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS,
105c6d3aaa4SStephen Smalley 	    "nlmsg_read", "nlmsg_write", NULL } },
106c6d3aaa4SStephen Smalley 	{ "netlink_firewall_socket",
107c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS,
108c6d3aaa4SStephen Smalley 	    "nlmsg_read", "nlmsg_write", NULL } },
109c6d3aaa4SStephen Smalley 	{ "netlink_tcpdiag_socket",
110c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS,
111c6d3aaa4SStephen Smalley 	    "nlmsg_read", "nlmsg_write", NULL } },
112c6d3aaa4SStephen Smalley 	{ "netlink_nflog_socket",
113c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS, NULL } },
114c6d3aaa4SStephen Smalley 	{ "netlink_xfrm_socket",
115c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS,
116c6d3aaa4SStephen Smalley 	    "nlmsg_read", "nlmsg_write", NULL } },
117c6d3aaa4SStephen Smalley 	{ "netlink_selinux_socket",
118c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS, NULL } },
119c6d3aaa4SStephen Smalley 	{ "netlink_audit_socket",
120c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS,
121c6d3aaa4SStephen Smalley 	    "nlmsg_read", "nlmsg_write", "nlmsg_relay", "nlmsg_readpriv",
122c6d3aaa4SStephen Smalley 	    "nlmsg_tty_audit", NULL } },
123c6d3aaa4SStephen Smalley 	{ "netlink_ip6fw_socket",
124c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS,
125c6d3aaa4SStephen Smalley 	    "nlmsg_read", "nlmsg_write", NULL } },
126c6d3aaa4SStephen Smalley 	{ "netlink_dnrt_socket",
127c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS, NULL } },
128c6d3aaa4SStephen Smalley 	{ "association",
129c6d3aaa4SStephen Smalley 	  { "sendto", "recvfrom", "setcontext", "polmatch", NULL } },
130c6d3aaa4SStephen Smalley 	{ "netlink_kobject_uevent_socket",
131c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS, NULL } },
132c6d3aaa4SStephen Smalley 	{ "appletalk_socket",
133c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS, NULL } },
134c6d3aaa4SStephen Smalley 	{ "packet",
135c6d3aaa4SStephen Smalley 	  { "send", "recv", "relabelto", "flow_in", "flow_out",
136c6d3aaa4SStephen Smalley 	    "forward_in", "forward_out", NULL } },
137c6d3aaa4SStephen Smalley 	{ "key",
138c6d3aaa4SStephen Smalley 	  { "view", "read", "write", "search", "link", "setattr", "create",
139c6d3aaa4SStephen Smalley 	    NULL } },
140c6d3aaa4SStephen Smalley 	{ "dccp_socket",
141c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS,
142c6d3aaa4SStephen Smalley 	    "node_bind", "name_connect", NULL } },
143c6d3aaa4SStephen Smalley 	{ "memprotect", { "mmap_zero", NULL } },
144c6d3aaa4SStephen Smalley 	{ "peer", { "recv", NULL } },
145c6d3aaa4SStephen Smalley 	{ "capability2", { "mac_override", "mac_admin", NULL } },
146c6d3aaa4SStephen Smalley 	{ "kernel_service", { "use_as_override", "create_files_as", NULL } },
147c6d3aaa4SStephen Smalley 	{ "tun_socket",
148c6d3aaa4SStephen Smalley 	  { COMMON_SOCK_PERMS, NULL } },
149c6d3aaa4SStephen Smalley 	{ NULL }
150c6d3aaa4SStephen Smalley   };
151