2017-12-19 00:14:33 +01:00
|
|
|
type stats, domain;
|
|
|
|
typeattribute stats coredomain;
|
2018-09-27 19:21:37 +02:00
|
|
|
type stats_exec, system_file_type, exec_type, file_type;
|
2017-12-19 00:14:33 +01:00
|
|
|
|
|
|
|
# switch to stats domain for stats command
|
|
|
|
domain_auto_trans(shell, stats_exec, stats)
|
|
|
|
|
|
|
|
# allow stats access to stdout from its parent shell.
|
|
|
|
allow stats shell:fd use;
|
|
|
|
|
|
|
|
# allow stats to communicate use, read and write over the adb
|
|
|
|
# connection.
|
|
|
|
allow stats adbd:fd use;
|
|
|
|
allow stats adbd:unix_stream_socket { read write };
|
|
|
|
|
|
|
|
# allow adbd to reap stats
|
|
|
|
allow stats adbd:process { sigchld };
|
|
|
|
|
|
|
|
# Allow the stats command to talk to the statsd over the binder, and get
|
|
|
|
# back the stats report data from a ParcelFileDescriptor.
|
|
|
|
binder_use(stats)
|
|
|
|
allow stats stats_service:service_manager find;
|
|
|
|
binder_call(stats, statsd)
|
|
|
|
allow stats statsd:fifo_file write;
|
|
|
|
|
2018-08-22 08:59:46 +02:00
|
|
|
# Only statsd can publish the binder service.
|
|
|
|
add_service(statsd, stats_service)
|
|
|
|
|
|
|
|
# Allow pipes from (and only from) stats.
|
|
|
|
allow statsd stats:fd use;
|
|
|
|
allow statsd stats:fifo_file write;
|
|
|
|
|
|
|
|
# Allow statsd to call back to stats with status updates.
|
|
|
|
binder_call(statsd, stats)
|
|
|
|
|
|
|
|
###
|
|
|
|
### neverallow rules
|
|
|
|
###
|
|
|
|
|
|
|
|
neverallow {
|
|
|
|
domain
|
|
|
|
-dumpstate
|
2019-10-29 22:13:20 +01:00
|
|
|
-gmscore_app
|
2020-02-05 00:55:59 +01:00
|
|
|
-gpuservice
|
2018-11-06 00:01:39 +01:00
|
|
|
-incidentd
|
2021-04-12 23:27:12 +02:00
|
|
|
-keystore
|
2021-03-12 12:57:38 +01:00
|
|
|
-mediametrics
|
2019-02-07 23:02:06 +01:00
|
|
|
-platform_app
|
2018-08-22 08:59:46 +02:00
|
|
|
-priv_app
|
|
|
|
-shell
|
|
|
|
-stats
|
|
|
|
-statsd
|
2019-09-24 03:45:05 +02:00
|
|
|
-surfaceflinger
|
2018-08-22 08:59:46 +02:00
|
|
|
-system_app
|
|
|
|
-system_server
|
|
|
|
-traceur_app
|
|
|
|
} stats_service:service_manager find;
|