1# storaged daemon
2type storaged, domain, coredomain, mlstrustedsubject;
3type storaged_exec, exec_type, file_type;
4
5init_daemon_domain(storaged)
6
7# Read access to pseudo filesystems
8r_dir_file(storaged, sysfs_type)
9r_dir_file(storaged, proc_net)
10r_dir_file(storaged, domain)
11
12# Read /proc/uid_io/stats
13allow storaged proc_uid_io_stats:file r_file_perms;
14
15# Read /data/system/packages.list
16allow storaged system_data_file:file r_file_perms;
17
18userdebug_or_eng(`
19  # Read access to debugfs
20  allow storaged debugfs_mmc:dir search;
21  allow storaged debugfs_mmc:file r_file_perms;
22')
23
24# Needed to provide debug dump output via dumpsys pipes.
25allow storaged shell:fd use;
26allow storaged shell:fifo_file write;
27
28# Needed for GMScore to call dumpsys storaged
29allow storaged priv_app:fd use;
30allow storaged app_data_file:file write;
31allow storaged permission_service:service_manager find;
32
33# Binder permissions
34add_service(storaged, storaged_service)
35
36binder_use(storaged)
37binder_call(storaged, system_server)
38
39# use batteryproperties service
40allow storaged batteryproperties_service:service_manager find;
41binder_call(storaged, healthd)
42
43# Kernel does extra check on CAP_DAC_OVERRIDE for libbinder when storaged is
44# running as root. See b/35323867 #3.
45dontaudit storaged self:capability dac_override;
46
47###
48### neverallow
49###
50neverallow storaged domain:process ptrace;
51neverallow storaged self:capability_class_set *;
52