Nick Kralevich | 0eb0a16 | 2018-12-12 09:06:05 -0800 | [diff] [blame] | 1 | type rs, domain, coredomain; |
| 2 | type rs_exec, system_file_type, exec_type, file_type; |
| 3 | |
| 4 | # Any files which would have been created as app_data_file |
| 5 | # will be created as rs_data_file instead. |
| 6 | allow rs app_data_file:dir ra_dir_perms; |
| 7 | allow rs rs_data_file:file create_file_perms; |
| 8 | type_transition rs app_data_file:file rs_data_file; |
| 9 | |
Nick Kralevich | 5cbe41b | 2018-12-19 12:09:42 -0800 | [diff] [blame^] | 10 | # Follow /data/user/0 symlink |
| 11 | allow rs system_data_file:lnk_file read; |
| 12 | |
Nick Kralevich | 0eb0a16 | 2018-12-12 09:06:05 -0800 | [diff] [blame] | 13 | # Read files from the app home directory. |
| 14 | allow rs app_data_file:file r_file_perms; |
| 15 | allow rs app_data_file:dir r_dir_perms; |
| 16 | |
| 17 | # Cleanup rs_data_file files in the app home directory. |
| 18 | allow rs app_data_file:dir remove_name; |
| 19 | |
| 20 | # Use vendor resources |
| 21 | allow rs vendor_file:dir r_dir_perms; |
| 22 | r_dir_file(rs, vendor_overlay_file) |
| 23 | r_dir_file(rs, vendor_app_file) |
| 24 | |
| 25 | # Read contents of app apks |
| 26 | r_dir_file(rs, apk_data_file) |
| 27 | |
| 28 | allow rs gpu_device:chr_file rw_file_perms; |
| 29 | allow rs ion_device:chr_file r_file_perms; |
| 30 | allow rs same_process_hal_file:file { r_file_perms execute }; |
| 31 | |
| 32 | # File descriptors passed from app to renderscript |
| 33 | allow rs untrusted_app_all:fd use; |
| 34 | |
| 35 | # TODO: Explain why these dontaudits are needed. Most likely |
| 36 | # these are file descriptors leaking across an exec() boundary |
| 37 | # due to a missing O_CLOEXEC / SOCK_CLOEXEC |
| 38 | dontaudit rs untrusted_app_all:unix_stream_socket { read write }; |
| 39 | dontaudit rs untrusted_app_all:fifo_file { read write }; |
| 40 | |
| 41 | # TODO: Explain why this is necessary. I think this is a zygote |
| 42 | # created logging socket and system server parceled file descriptor |
| 43 | # which is not using the O_CLOEXEC flag. |
| 44 | dontaudit rs zygote:fd use; |
| 45 | dontaudit rs system_server:fd use; |