blob: 698999f515bd59bbfc0a28172531e2eb1f46e657 [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
Jin Qianaf3eaf02017-03-23 12:28:20 -070024# Needed to provide debug dump output via dumpsys pipes.
25allow storaged shell:fd use;
26allow storaged shell:fifo_file write;
27
ynwange68d2d22016-07-01 12:18:54 -070028# Binder permissions
William Roberts606d2fd2017-01-19 13:23:52 -080029add_service(storaged, storaged_service)
Jin Qiand3459062017-01-11 16:20:49 -080030
ynwange68d2d22016-07-01 12:18:54 -070031binder_use(storaged)
32binder_call(storaged, system_server)
33
Jin Qian61670b82017-02-06 11:04:31 -080034# use batteryproperties service
35allow storaged batteryproperties_service:service_manager find;
36binder_call(storaged, healthd)
37
Jin Qiand3a11612017-02-22 17:27:57 -080038# Kernel does extra check on CAP_DAC_OVERRIDE for libbinder when storaged is
39# running as root. See b/35323867 #3.
40dontaudit storaged self:capability dac_override;
41
ynwange68d2d22016-07-01 12:18:54 -070042###
43### neverallow
44###
45neverallow storaged domain:process ptrace;
Jin Qiand3a11612017-02-22 17:27:57 -080046neverallow storaged self:capability_class_set *;