blob: 77b21bee0134c1046b12659c481603502d7b074f [file] [log] [blame]
Stephen Smalleyb3cb9692014-02-21 13:45:29 -05001# Domain for shell processes spawned by ADB or console service.
Stephen Smalley42fb8242014-06-11 07:10:09 -04002type shell, domain, mlstrustedsubject;
Stephen Smalley01301542013-09-27 10:38:14 -04003type shell_exec, exec_type, file_type;
Stephen Smalley2dd4e512012-01-04 12:33:27 -05004
Stephen Smalley396015c2014-01-07 12:47:10 -05005# Create and use network sockets.
6net_domain(shell)
7
Stephen Smalley2dd4e512012-01-04 12:33:27 -05008# Run app_process.
Stephen Smalley712ca0a2013-10-23 13:25:53 -04009# XXX Transition into its own domain?
Stephen Smalley2dd4e512012-01-04 12:33:27 -050010app_domain(shell)
Stephen Smalleyd99e6d52013-12-02 14:18:11 -050011
Mark Salyzynad5315d2014-03-17 13:00:38 -070012# logd access
13read_logd(shell)
14control_logd(shell)
15
Nick Kralevich4fd4a202014-06-05 13:27:44 -070016# read files in /data/anr
17allow shell anr_data_file:dir r_dir_perms;
18allow shell anr_data_file:file r_file_perms;
19
Stephen Smalley42fb8242014-06-11 07:10:09 -040020# Access /data/local/tmp.
21allow shell shell_data_file:dir create_dir_perms;
22allow shell shell_data_file:file create_file_perms;
23allow shell shell_data_file:file rx_file_perms;
Brian Carlstrom6e12daf2014-12-09 23:49:31 -080024allow shell shell_data_file:lnk_file create_file_perms;
Stephen Smalley42fb8242014-06-11 07:10:09 -040025
26# adb bugreport
27unix_socket_connect(shell, dumpstate, dumpstate)
28
Stephen Smalley42fb8242014-06-11 07:10:09 -040029allow shell devpts:chr_file rw_file_perms;
30allow shell tty_device:chr_file rw_file_perms;
31allow shell console_device:chr_file rw_file_perms;
Stephen Smalleya2e4e262014-06-11 12:09:15 -040032allow shell input_device:dir r_dir_perms;
Stephen Smalley42fb8242014-06-11 07:10:09 -040033allow shell input_device:chr_file rw_file_perms;
34allow shell system_file:file x_file_perms;
35allow shell shell_exec:file rx_file_perms;
36allow shell zygote_exec:file rx_file_perms;
37
38r_dir_file(shell, apk_data_file)
39
40# Set properties.
41unix_socket_connect(shell, property, init)
42allow shell shell_prop:property_service set;
43allow shell ctl_dumpstate_prop:property_service set;
44allow shell debug_prop:property_service set;
45allow shell powerctl_prop:property_service set;
46
47# systrace support - allow atrace to run
48# debugfs doesn't support labeling individual files, so we have
49# to grant read access to all of /sys/kernel/debug.
50# Directory read access and file write access is already granted
51# in domain.te.
52allow shell debugfs:file r_file_perms;
53
54# allow shell to run dmesg
55allow shell kernel:system syslog_read;