blob: 906373b9f6ff5fca5733e0bb6e1680487b890141 [file] [log] [blame]
Hongguang737b0982021-06-09 09:36:39 -07001# Any files which would have been created as app_data_file and
2# privapp_data_file will be created as app_exec_data_file instead.
3allow rs { app_data_file privapp_data_file }:dir ra_dir_perms;
Nick Kralevichfb66c6f2019-01-11 09:37:46 -08004allow rs app_exec_data_file:file create_file_perms;
5type_transition rs app_data_file:file app_exec_data_file;
Hongguang737b0982021-06-09 09:36:39 -07006type_transition rs privapp_data_file:file app_exec_data_file;
Nick Kralevich0eb0a162018-12-12 09:06:05 -08007
Nick Kralevich5cbe41b2018-12-19 12:09:42 -08008# Follow /data/user/0 symlink
9allow rs system_data_file:lnk_file read;
10
Nick Kralevich0eb0a162018-12-12 09:06:05 -080011# Read files from the app home directory.
Hongguang737b0982021-06-09 09:36:39 -070012allow rs { app_data_file privapp_data_file }:file r_file_perms;
13allow rs { app_data_file privapp_data_file }:dir r_dir_perms;
Nick Kralevich0eb0a162018-12-12 09:06:05 -080014
Nick Kralevichfb66c6f2019-01-11 09:37:46 -080015# Cleanup app_exec_data_file files in the app home directory.
Hongguang737b0982021-06-09 09:36:39 -070016allow rs { app_data_file privapp_data_file }:dir remove_name;
Nick Kralevich0eb0a162018-12-12 09:06:05 -080017
18# Use vendor resources
19allow rs vendor_file:dir r_dir_perms;
20r_dir_file(rs, vendor_overlay_file)
21r_dir_file(rs, vendor_app_file)
Jooyung Han7c4f8a82023-06-09 13:26:54 +090022# Vendor overlay can be found in vendor apex
23allow rs vendor_apex_metadata_file:dir { getattr search };
Nick Kralevich0eb0a162018-12-12 09:06:05 -080024
25# Read contents of app apks
26r_dir_file(rs, apk_data_file)
27
28allow rs gpu_device:chr_file rw_file_perms;
29allow rs ion_device:chr_file r_file_perms;
30allow rs same_process_hal_file:file { r_file_perms execute };
31
32# File descriptors passed from app to renderscript
Hongguang737b0982021-06-09 09:36:39 -070033allow rs { untrusted_app_all ephemeral_app priv_app }:fd use;
Jeff Vander Stoep561aa012019-01-17 14:44:29 -080034
35# rs can access app data, so ensure it can only be entered via an app domain and cannot have
36# CAP_DAC_OVERRIDE.
37neverallow rs rs:capability_class_set *;
38neverallow { domain -appdomain } rs:process { dyntransition transition };
39neverallow rs { domain -crash_dump }:process { dyntransition transition };
Steven Morelandf3722d52023-05-22 23:45:40 +000040neverallow rs app_data_file_type:file_class_set ~r_file_perms;
Jeff Vander Stoep561aa012019-01-17 14:44:29 -080041# rs should never use network sockets
42neverallow rs *:network_socket_class_set *;