2016-06-18 00:05:10 +02:00
|
|
|
# storaged daemon
|
2017-03-23 22:27:32 +01:00
|
|
|
type storaged, domain, coredomain, mlstrustedsubject;
|
2018-09-27 19:21:37 +02:00
|
|
|
type storaged_exec, system_file_type, exec_type, file_type;
|
2016-06-18 00:05:10 +02:00
|
|
|
|
|
|
|
init_daemon_domain(storaged)
|
|
|
|
|
|
|
|
# Read access to pseudo filesystems
|
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-08-15 02:01:25 +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;
|
2018-08-03 00:54:23 +02:00
|
|
|
allow storaged { privapp_data_file app_data_file }:file write;
|
2017-04-13 02:38:11 +02:00
|
|
|
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-09-26 04:40:59 +02:00
|
|
|
hal_client_domain(storaged, hal_health)
|
2017-02-06 20:04:31 +01:00
|
|
|
|
2017-05-03 19:26:40 +02:00
|
|
|
# Implements a dumpsys interface.
|
|
|
|
allow storaged dumpstate:fd use;
|
|
|
|
|
2017-08-02 16:27:44 +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.
|
2018-09-07 00:19:40 +02:00
|
|
|
dontaudit storaged self:global_capability_class_set { dac_override dac_read_search };
|
2017-02-23 02:27:57 +01:00
|
|
|
|
2018-03-02 23:14:44 +01:00
|
|
|
# For collecting bugreports.
|
|
|
|
allow storaged dumpstate:fifo_file write;
|
|
|
|
|
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 *;
|