blob: 96433b308535cd63f48306eaccf43dc33d54cd9f [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 Qiana239f302017-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
Jin Qian00a17892017-04-12 17:38:11 -070028# 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
ynwange68d2d22016-07-01 12:18:54 -070033# Binder permissions
William Roberts606d2fd2017-01-19 13:23:52 -080034add_service(storaged, storaged_service)
Jin Qiand3459062017-01-11 16:20:49 -080035
ynwange68d2d22016-07-01 12:18:54 -070036binder_use(storaged)
37binder_call(storaged, system_server)
38
Jin Qian61670b82017-02-06 11:04:31 -080039# use batteryproperties service
40allow storaged batteryproperties_service:service_manager find;
41binder_call(storaged, healthd)
42
Jin Qiand3a11612017-02-22 17:27:57 -080043# 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
ynwange68d2d22016-07-01 12:18:54 -070047###
48### neverallow
49###
50neverallow storaged domain:process ptrace;
Jin Qiand3a11612017-02-22 17:27:57 -080051neverallow storaged self:capability_class_set *;