2016-06-18 00:05:10 +02:00
|
|
|
# storaged daemon
|
2017-03-23 22:27:32 +01:00
|
|
|
type storaged, domain, coredomain, 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;
|
|
|
|
|
2017-09-26 21:58:29 +02:00
|
|
|
# Store storaged proto file
|
|
|
|
allow storaged storaged_data_file:dir rw_dir_perms;
|
|
|
|
allow storaged storaged_data_file:file create_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
|
|
|
|
2017-03-23 20:28:20 +01:00
|
|
|
# Needed to provide debug dump output via dumpsys pipes.
|
|
|
|
allow storaged shell:fd use;
|
|
|
|
allow storaged shell:fifo_file write;
|
|
|
|
|
2017-04-13 02:38:11 +02:00
|
|
|
# Needed for GMScore to call dumpsys storaged
|
|
|
|
allow storaged priv_app:fd use;
|
|
|
|
allow storaged app_data_file:file write;
|
|
|
|
allow storaged permission_service:service_manager find;
|
|
|
|
|
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-05-03 19:26:40 +02:00
|
|
|
# Implements a dumpsys interface.
|
|
|
|
allow storaged dumpstate:fd use;
|
|
|
|
|
2017-09-26 21:58:29 +02:00
|
|
|
# use a subset of the package manager service
|
|
|
|
allow storaged package_native_service:service_manager find;
|
|
|
|
|
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 *;
|