blob: a76c3d8a9a3ab272bc16ce365491ab4b0bfcfeec [file] [log] [blame]
Nick Kralevich84d88312013-10-21 13:32:31 -07001#######################################################
2#
3# This is the unconfined template. This template is the base policy
4# which is used by daemons and other privileged components of
5# Android.
6#
7# Historically, this template was called "unconfined" because it
8# allowed the domain to do anything it wanted. Over time,
9# this has changed, and will continue to change in the future.
10# The rules in this file will be removed when no remaining
11# unconfined domains require it, or when the rules contradict
12# Android security best practices. Domains which need rules not
13# provided by the unconfined template should add them directly to
14# the relevant policy.
15#
16# The use of this template is discouraged.
17######################################################
18
Nick Kralevichfa34d472014-05-19 22:54:07 -070019allow unconfineddomain self:capability ~{ sys_ptrace sys_rawio mknod sys_module audit_write audit_control linux_immutable };
Stephen Smalley04ee5df2014-01-30 13:23:08 -050020allow unconfineddomain self:capability2 ~{ mac_override mac_admin };
Stephen Smalley853ffaa2014-03-06 13:02:50 -050021allow unconfineddomain kernel:security ~{ load_policy setenforce setcheckreqprot setbool setsecparam };
Nick Kralevich685e2f92014-05-28 13:48:52 -070022allow unconfineddomain kernel:system ~{ syslog_read syslog_mod syslog_console };
Stephen Smalley2dd4e512012-01-04 12:33:27 -050023allow unconfineddomain domain:fd *;
24allow unconfineddomain domain:dir r_dir_perms;
25allow unconfineddomain domain:lnk_file r_file_perms;
26allow unconfineddomain domain:{ fifo_file file } rw_file_perms;
Nick Kralevich0db95cc2014-06-20 21:15:56 -070027allow unconfineddomain domain:{
28 socket
29 netlink_socket
30 key_socket
31 unix_stream_socket
32 unix_dgram_socket
33 netlink_route_socket
34 netlink_firewall_socket
35 netlink_tcpdiag_socket
36 netlink_nflog_socket
37 netlink_xfrm_socket
38 netlink_selinux_socket
39 netlink_audit_socket
40 netlink_ip6fw_socket
41 netlink_dnrt_socket
42 netlink_kobject_uevent_socket
43 tun_socket
44} *;
Stephen Smalley2dd4e512012-01-04 12:33:27 -050045allow unconfineddomain domain:ipc_class_set *;
46allow unconfineddomain domain:key *;
Stephen Smalleyee615282014-06-20 14:03:20 -040047allow unconfineddomain {fs_type -contextmount_type -sdcard_type}:{ dir lnk_file sock_file fifo_file } ~relabelto;
Stephen Smalley75e2ef92014-06-16 13:05:38 -040048allow unconfineddomain dev_type:{ dir lnk_file sock_file fifo_file } ~relabelto;
Nick Kralevichee49c0e2014-06-07 10:00:59 -070049allow unconfineddomain {
50 file_type
51 -keystore_data_file
52 -property_data_file
53 -system_file
54 -exec_type
55 -security_file
56 -shell_data_file
Stephen Smalley631a5a82014-06-20 13:54:10 -040057 -app_data_file
Nick Kralevichee49c0e2014-06-07 10:00:59 -070058}:{ dir lnk_file sock_file fifo_file } ~relabelto;
Stephen Smalley5622cca2014-06-17 15:59:58 -040059allow unconfineddomain exec_type:dir r_dir_perms;
Stephen Smalleya893eda2014-06-23 12:47:16 -040060allow unconfineddomain exec_type:file { r_file_perms execute };
Stephen Smalley5622cca2014-06-17 15:59:58 -040061allow unconfineddomain exec_type:lnk_file r_file_perms;
62allow unconfineddomain system_file:dir r_dir_perms;
Stephen Smalleya893eda2014-06-23 12:47:16 -040063allow unconfineddomain system_file:file { r_file_perms execute };
Stephen Smalley5622cca2014-06-17 15:59:58 -040064allow unconfineddomain system_file:lnk_file r_file_perms;
Stephen Smalley75e2ef92014-06-16 13:05:38 -040065allow unconfineddomain {
66 fs_type
67 -usermodehelper
68 -proc_security
69 -contextmount_type
Stephen Smalley04b8a752014-06-19 11:26:22 -040070 -rootfs
Stephen Smalleyee615282014-06-20 14:03:20 -040071 -sdcard_type
Stephen Smalleyf3c3a1a2014-06-19 09:07:17 -040072}:{ chr_file file } ~{entrypoint execute_no_trans execmod execute relabelto};
73allow unconfineddomain {dev_type -kmem_device}:{ chr_file file } ~{entrypoint execute_no_trans execmod execute relabelto};
Nick Kralevichee49c0e2014-06-07 10:00:59 -070074allow unconfineddomain {
75 file_type
76 -keystore_data_file
77 -property_data_file
78 -system_file
79 -exec_type
80 -security_file
81 -shell_data_file
Stephen Smalley631a5a82014-06-20 13:54:10 -040082 -app_data_file
Stephen Smalleyf3c3a1a2014-06-19 09:07:17 -040083}:{ chr_file file } ~{entrypoint execute_no_trans execmod execute relabelto};
Stephen Smalley5622cca2014-06-17 15:59:58 -040084allow unconfineddomain rootfs:file execute;
Stephen Smalley75e2ef92014-06-16 13:05:38 -040085allow unconfineddomain contextmount_type:dir r_dir_perms;
86allow unconfineddomain contextmount_type:notdevfile_class_set r_file_perms;
Stephen Smalley2dd4e512012-01-04 12:33:27 -050087allow unconfineddomain node_type:node *;
Stephen Smalley2dd4e512012-01-04 12:33:27 -050088allow unconfineddomain netif_type:netif *;
Stephen Smalley2dd4e512012-01-04 12:33:27 -050089allow unconfineddomain domain:peer recv;
Nick Kralevicha730e502014-01-03 20:44:07 -080090allow unconfineddomain { domain -init }:binder { call transfer set_context_mgr };