blob: 3dbabf6f2aa6a322635e029c2d77226fd5edef39 [file] [log] [blame]
ynwang9fa88232016-06-17 15:05:10 -07001# storaged daemon
Alex Klyubinf5446eb2017-03-23 14:27:32 -07002type storaged, domain, coredomain, mlstrustedsubject;
ynwang9fa88232016-06-17 15:05:10 -07003type storaged_exec, exec_type, file_type;
4
5init_daemon_domain(storaged)
6
ynwang9fa88232016-06-17 15:05:10 -07007# Read access to pseudo filesystems
ynwang9fa88232016-06-17 15:05:10 -07008r_dir_file(storaged, sysfs_type)
9r_dir_file(storaged, proc_net)
ynwange68d2d22016-07-01 12:18:54 -070010r_dir_file(storaged, domain)
ynwang9fa88232016-06-17 15:05:10 -070011
Jin Qiand3459062017-01-11 16:20:49 -080012# Read /proc/uid_io/stats
13allow storaged proc_uid_io_stats:file r_file_perms;
14
Jin Qian8ad57ef2017-01-20 20:29:13 -080015# Read /data/system/packages.list
16allow storaged system_data_file:file r_file_perms;
17
ynwange68d2d22016-07-01 12:18:54 -070018userdebug_or_eng(`
19 # Read access to debugfs
20 allow storaged debugfs_mmc:dir search;
21 allow storaged debugfs_mmc:file r_file_perms;
22')
ynwang9fa88232016-06-17 15:05:10 -070023
ynwange68d2d22016-07-01 12:18:54 -070024# Binder permissions
William Roberts606d2fd2017-01-19 13:23:52 -080025add_service(storaged, storaged_service)
Jin Qiand3459062017-01-11 16:20:49 -080026
ynwange68d2d22016-07-01 12:18:54 -070027binder_use(storaged)
28binder_call(storaged, system_server)
29
Jin Qian61670b82017-02-06 11:04:31 -080030# use batteryproperties service
31allow storaged batteryproperties_service:service_manager find;
32binder_call(storaged, healthd)
33
Jin Qiand3a11612017-02-22 17:27:57 -080034# Kernel does extra check on CAP_DAC_OVERRIDE for libbinder when storaged is
35# running as root. See b/35323867 #3.
36dontaudit storaged self:capability dac_override;
37
ynwange68d2d22016-07-01 12:18:54 -070038###
39### neverallow
40###
41neverallow storaged domain:process ptrace;
Jin Qiand3a11612017-02-22 17:27:57 -080042neverallow storaged self:capability_class_set *;