blob: ef0d12e5a0332311e2d231fee41bc544679678b5 [file] [log] [blame]
Stephen Smalley2dd4e512012-01-04 12:33:27 -05001#
2# Apps that run with the system UID, e.g. com.android.system.ui,
3# com.android.settings. These are not as privileged as the system
4# server.
5#
6type system_app, domain;
7app_domain(system_app)
8
9# Perform binder IPC to any app domain.
10binder_call(system_app, appdomain)
11binder_transfer(system_app, appdomain)
12
13# Read and write system data files.
14# May want to split into separate types.
15allow system_app system_data_file:dir create_dir_perms;
16allow system_app system_data_file:file create_file_perms;
17
18# Write to dalvikcache.
19allow system_app dalvikcache_data_file:file { write setattr };
20
21# Talk to keystore.
22unix_socket_connect(system_app, keystore, keystore)
23
24# Read SELinux enforcing status.
25selinux_getenforce(system_app)
26
Stephen Smalley4c6f1ce2012-02-02 13:28:44 -050027bool settings_manage_selinux true;
28if (settings_manage_selinux) {
29# Allow settings app to set SELinux to enforcing
30selinux_setenforce(system_app)
31
32# Allow settings app to set SELinux booleans
33selinux_setbool(system_app)
34}
35
Stephen Smalley2dd4e512012-01-04 12:33:27 -050036#
37# System Server aka system_server spawned by zygote.
38# Most of the framework services run in this process.
39#
40type system, domain, mlstrustedsubject;
41
42# Child of the zygote.
43allow system zygote:fd use;
44allow system zygote:process sigchld;
45allow system zygote_tmpfs:file read;
46
47# system server gets network and bluetooth permissions.
48net_domain(system)
49bluetooth_domain(system)
50
51# These are the capabilities assigned by the zygote to the
52# system server.
53# XXX See if we can remove some of these.
54allow system self:capability { kill net_bind_service net_broadcast net_admin net_raw sys_module sys_boot sys_nice sys_resource sys_time sys_tty_config };
55
56# Use netlink uevent sockets.
57allow system self:netlink_kobject_uevent_socket *;
58
59# Kill apps.
60allow system appdomain:process { sigkill signal };
61
Stephen Smalley0d76f4e2012-01-10 13:21:28 -050062# Set scheduling info for apps.
63allow system appdomain:process setsched;
64
Stephen Smalley2dd4e512012-01-04 12:33:27 -050065# Read /proc data for apps.
66allow system appdomain:dir r_dir_perms;
67allow system appdomain:{ file lnk_file } rw_file_perms;
68
69# Write to /proc/net/xt_qtaguid/ctrl.
70# XXX Split /proc/net into its own type.
71allow system proc:file write;
72
73# Notify init of death.
74allow system init:process sigchld;
75
76# Talk to init and various daemons via sockets.
77unix_socket_connect(system, property, init)
78unix_socket_connect(system, qemud, qemud)
79unix_socket_connect(system, installd, installd)
80unix_socket_connect(system, netd, netd)
81unix_socket_connect(system, vold, vold)
82unix_socket_connect(system, zygote, zygote)
83unix_socket_connect(system, keystore, keystore)
84unix_socket_connect(system, dbus, dbusd)
85unix_socket_connect(system, gps, gpsd)
86unix_socket_connect(system, bluetooth, bluetoothd)
87unix_socket_send(system, wpa, wpa)
88
89# Perform Binder IPC.
90tmpfs_domain(system)
91binder_use(system)
92binder_call(system, binderservicedomain)
93binder_call(system, appdomain)
94binder_service(system)
95# Transfer other Binder references.
96binder_transfer(system, binderservicedomain)
97binder_transfer(system, appdomain)
98
99# Read /proc/pid files for Binder clients.
100r_dir_file(system, appdomain)
101r_dir_file(system, mediaserver)
102allow system appdomain:process getattr;
103allow system mediaserver:process getattr;
104
105# Specify any arguments to zygote.
106allow system self:zygote *;
107
108# Check SELinux permissions.
109selinux_check_access(system)
110
111# XXX Label sysfs files with a specific type?
112allow system sysfs:file rw_file_perms;
113
114# Access devices.
Stephen Smalleyc94e2392012-01-06 10:25:53 -0500115allow system device:dir r_dir_perms;
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500116allow system device:chr_file rw_file_perms;
117allow system akm_device:chr_file rw_file_perms;
118allow system accelerometer_device:chr_file rw_file_perms;
119allow system alarm_device:chr_file rw_file_perms;
120allow system graphics_device:dir search;
121allow system graphics_device:chr_file rw_file_perms;
122allow system input_device:dir r_dir_perms;
123allow system input_device:chr_file rw_file_perms;
124allow system tty_device:chr_file rw_file_perms;
125allow system urandom_device:chr_file rw_file_perms;
126allow system video_device:chr_file rw_file_perms;
127allow system qemu_device:chr_file rw_file_perms;
128
129# Manage data files.
130allow system data_file_type:dir create_dir_perms;
131allow system data_file_type:notdevfile_class_set create_file_perms;
132
133# Create a socket for receiving info from wpa.
134type_transition system wifi_data_file:sock_file system_wpa_socket;
135allow system system_wpa_socket:sock_file create_file_perms;
136
137# Manage cache files.
138allow system cache_file:dir create_dir_perms;
139allow system cache_file:file create_file_perms;
140
141# Run system programs, e.g. dexopt.
142allow system system_file:file x_file_perms;
143
144# Silently deny any /proc accesses that are not allowed.
145# This suppresses noise from walking the process list.
146dontaudit system domain:dir r_dir_perms;
147dontaudit system domain:file r_file_perms;