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