1# storaged daemon 2type storaged, domain, coredomain, mlstrustedsubject; 3type storaged_exec, system_file_type, exec_type, file_type; 4 5init_daemon_domain(storaged) 6 7# Read access to pseudo filesystems 8r_dir_file(storaged, domain) 9 10# Read /proc/uid_io/stats 11allow storaged proc_uid_io_stats:file r_file_perms; 12 13# Read /data/system/packages.list 14allow storaged system_data_file:file r_file_perms; 15allow storaged packages_list_file:file r_file_perms; 16 17# Store storaged proto file 18allow storaged storaged_data_file:dir rw_dir_perms; 19allow storaged storaged_data_file:file create_file_perms; 20 21no_debugfs_restriction(` 22 userdebug_or_eng(` 23 # Read access to debugfs 24 allow storaged debugfs_mmc:dir search; 25 allow storaged debugfs_mmc:file r_file_perms; 26 ') 27') 28 29# Needed to provide debug dump output via dumpsys pipes. 30allow storaged shell:fd use; 31allow storaged shell:fifo_file write; 32 33# Needed for GMScore to call dumpsys storaged 34allow storaged priv_app:fd use; 35# b/142672293: No other priv-app should need this allow rule now that GMS core runs in its own domain. 36# Remove after no logs are seen for this rule. 37userdebug_or_eng(` 38 auditallow storaged priv_app:fd use; 39') 40allow storaged gmscore_app:fd use; 41allow storaged { privapp_data_file app_data_file }:file write; 42allow storaged permission_service:service_manager find; 43 44# Binder permissions 45add_service(storaged, storaged_service) 46 47binder_use(storaged) 48binder_call(storaged, system_server) 49 50hal_client_domain(storaged, hal_health) 51 52# Implements a dumpsys interface. 53allow storaged dumpstate:fd use; 54 55# use a subset of the package manager service 56allow storaged package_native_service:service_manager find; 57 58# Kernel does extra check on CAP_DAC_OVERRIDE for libbinder when storaged is 59# running as root. See b/35323867 #3. 60dontaudit storaged self:global_capability_class_set { dac_override dac_read_search }; 61 62# For collecting bugreports. 63allow storaged dumpstate:fifo_file write; 64 65### 66### neverallow 67### 68neverallow storaged domain:process ptrace; 69neverallow storaged self:capability_class_set *; 70