blob: 1394350bcd7f1b8b9ea8e3ca6f192275de65a0c8 [file] [log] [blame]
Stephen Smalley712ca0a2013-10-23 13:25:53 -04001# Rules for all shell domains (e.g. console service and adb shell).
2
3# Access /data/local/tmp.
4allow shelldomain shell_data_file:dir create_dir_perms;
5allow shelldomain shell_data_file:file create_file_perms;
6allow shelldomain shell_data_file:file rx_file_perms;
7
8# Access sdcard.
9allow shelldomain sdcard_type:dir rw_dir_perms;
10allow shelldomain sdcard_type:file create_file_perms;
11
12# adb bugreport
13unix_socket_connect(shelldomain, dumpstate, dumpstate)
14
15allow shelldomain rootfs:dir r_dir_perms;
16allow shelldomain devpts:chr_file rw_file_perms;
17allow shelldomain tty_device:chr_file rw_file_perms;
18allow shelldomain console_device:chr_file rw_file_perms;
19allow shelldomain input_device:chr_file rw_file_perms;
20allow shelldomain system_file:file x_file_perms;
21allow shelldomain shell_exec:file rx_file_perms;
22allow shelldomain zygote_exec:file rx_file_perms;
23
24r_dir_file(shelldomain, apk_data_file)
25allow shelldomain dalvikcache_data_file:file { write setattr };
26
27# Set properties.
28unix_socket_connect(shelldomain, property, init)
29allow shelldomain shell_prop:property_service set;
30allow shelldomain ctl_dumpstate_prop:property_service set;
Nick Kralevich20a791a2013-12-19 21:55:12 -080031allow shelldomain debug_prop:property_service set;
32allow shelldomain powerctl_prop:property_service set;
Stephen Smalley712ca0a2013-10-23 13:25:53 -040033
34# ndk-gdb invokes adb shell ps to find the app PID.
35r_dir_file(shelldomain, non_system_app_set)
36
37# ndk-gdb invokes adb shell ls to check the app data dir.
38allow shelldomain app_data_file:dir search;
39
40# ps and ps -Z output for app processes.
41r_dir_file(shelldomain, appdomain)
42allow shelldomain appdomain:process getattr;