2016-06-18 00:05:10 +02:00
|
|
|
# storaged daemon
|
2016-07-01 21:18:54 +02:00
|
|
|
type storaged, domain, mlstrustedsubject;
|
2016-06-18 00:05:10 +02:00
|
|
|
type storaged_exec, exec_type, file_type;
|
|
|
|
|
|
|
|
init_daemon_domain(storaged)
|
|
|
|
|
|
|
|
# Read access to pseudo filesystems
|
|
|
|
r_dir_file(storaged, sysfs_type)
|
|
|
|
r_dir_file(storaged, proc_net)
|
2016-07-01 21:18:54 +02:00
|
|
|
r_dir_file(storaged, domain)
|
2016-06-18 00:05:10 +02:00
|
|
|
|
2017-01-12 01:20:49 +01:00
|
|
|
# Read /proc/uid_io/stats
|
|
|
|
allow storaged proc_uid_io_stats:file r_file_perms;
|
|
|
|
|
2017-01-21 05:29:13 +01:00
|
|
|
# Read /data/system/packages.list
|
|
|
|
allow storaged system_data_file:file r_file_perms;
|
|
|
|
|
2016-07-01 21:18:54 +02:00
|
|
|
userdebug_or_eng(`
|
|
|
|
# Read access to debugfs
|
|
|
|
allow storaged debugfs_mmc:dir search;
|
|
|
|
allow storaged debugfs_mmc:file r_file_perms;
|
|
|
|
')
|
2016-06-18 00:05:10 +02:00
|
|
|
|
2016-07-01 21:18:54 +02:00
|
|
|
# Binder permissions
|
2017-01-19 22:23:52 +01:00
|
|
|
add_service(storaged, storaged_service)
|
2017-01-12 01:20:49 +01:00
|
|
|
|
2016-07-01 21:18:54 +02:00
|
|
|
binder_use(storaged)
|
|
|
|
binder_call(storaged, system_server)
|
|
|
|
|
2017-02-06 20:04:31 +01:00
|
|
|
# use batteryproperties service
|
|
|
|
allow storaged batteryproperties_service:service_manager find;
|
|
|
|
binder_call(storaged, healthd)
|
|
|
|
|
2017-02-23 02:27:57 +01:00
|
|
|
# Kernel does extra check on CAP_DAC_OVERRIDE for libbinder when storaged is
|
|
|
|
# running as root. See b/35323867 #3.
|
|
|
|
dontaudit storaged self:capability dac_override;
|
|
|
|
|
2016-07-01 21:18:54 +02:00
|
|
|
###
|
|
|
|
### neverallow
|
|
|
|
###
|
|
|
|
neverallow storaged domain:process ptrace;
|
2017-02-23 02:27:57 +01:00
|
|
|
neverallow storaged self:capability_class_set *;
|