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# Implements a dumpsys interface.
44allow storaged dumpstate:fd use;
45
46# use a subset of the package manager service
47allow storaged package_native_service:service_manager find;
48
49# Kernel does extra check on CAP_DAC_OVERRIDE for libbinder when storaged is
50# running as root. See b/35323867 #3.
51dontaudit storaged self:capability dac_override;
52
53###
54### neverallow
55###
56neverallow storaged domain:process ptrace;
57neverallow storaged self:capability_class_set *;
58