1*e4a36f41SAndroid Build Coastguard Worker# Any files which would have been created as app_data_file 2*e4a36f41SAndroid Build Coastguard Worker# will be created as app_exec_data_file instead. 3*e4a36f41SAndroid Build Coastguard Workerallow rs app_data_file:dir ra_dir_perms; 4*e4a36f41SAndroid Build Coastguard Workerallow rs app_exec_data_file:file create_file_perms; 5*e4a36f41SAndroid Build Coastguard Workertype_transition rs app_data_file:file app_exec_data_file; 6*e4a36f41SAndroid Build Coastguard Worker 7*e4a36f41SAndroid Build Coastguard Worker# Follow /data/user/0 symlink 8*e4a36f41SAndroid Build Coastguard Workerallow rs system_data_file:lnk_file read; 9*e4a36f41SAndroid Build Coastguard Worker 10*e4a36f41SAndroid Build Coastguard Worker# Read files from the app home directory. 11*e4a36f41SAndroid Build Coastguard Workerallow rs app_data_file:file r_file_perms; 12*e4a36f41SAndroid Build Coastguard Workerallow rs app_data_file:dir r_dir_perms; 13*e4a36f41SAndroid Build Coastguard Worker 14*e4a36f41SAndroid Build Coastguard Worker# Cleanup app_exec_data_file files in the app home directory. 15*e4a36f41SAndroid Build Coastguard Workerallow rs app_data_file:dir remove_name; 16*e4a36f41SAndroid Build Coastguard Worker 17*e4a36f41SAndroid Build Coastguard Worker# Use vendor resources 18*e4a36f41SAndroid Build Coastguard Workerallow rs vendor_file:dir r_dir_perms; 19*e4a36f41SAndroid Build Coastguard Workerr_dir_file(rs, vendor_overlay_file) 20*e4a36f41SAndroid Build Coastguard Workerr_dir_file(rs, vendor_app_file) 21*e4a36f41SAndroid Build Coastguard Worker 22*e4a36f41SAndroid Build Coastguard Worker# Read contents of app apks 23*e4a36f41SAndroid Build Coastguard Workerr_dir_file(rs, apk_data_file) 24*e4a36f41SAndroid Build Coastguard Worker 25*e4a36f41SAndroid Build Coastguard Workerallow rs gpu_device:chr_file rw_file_perms; 26*e4a36f41SAndroid Build Coastguard Workerallow rs ion_device:chr_file r_file_perms; 27*e4a36f41SAndroid Build Coastguard Workerallow rs same_process_hal_file:file { r_file_perms execute }; 28*e4a36f41SAndroid Build Coastguard Worker 29*e4a36f41SAndroid Build Coastguard Worker# File descriptors passed from app to renderscript 30*e4a36f41SAndroid Build Coastguard Workerallow rs { untrusted_app_all ephemeral_app }:fd use; 31*e4a36f41SAndroid Build Coastguard Worker 32*e4a36f41SAndroid Build Coastguard Worker# rs can access app data, so ensure it can only be entered via an app domain and cannot have 33*e4a36f41SAndroid Build Coastguard Worker# CAP_DAC_OVERRIDE. 34*e4a36f41SAndroid Build Coastguard Workerneverallow rs rs:capability_class_set *; 35*e4a36f41SAndroid Build Coastguard Workerneverallow { domain -appdomain } rs:process { dyntransition transition }; 36*e4a36f41SAndroid Build Coastguard Workerneverallow rs { domain -crash_dump }:process { dyntransition transition }; 37*e4a36f41SAndroid Build Coastguard Workerneverallow rs app_data_file:file_class_set ~r_file_perms; 38*e4a36f41SAndroid Build Coastguard Worker# rs should never use network sockets 39*e4a36f41SAndroid Build Coastguard Workerneverallow rs *:network_socket_class_set *; 40