2017-01-24 21:53:45 +01:00
|
|
|
# mediametrics - daemon for collecting media.metrics data
|
|
|
|
type mediametrics, domain;
|
|
|
|
type mediametrics_exec, exec_type, file_type;
|
|
|
|
|
|
|
|
|
|
|
|
binder_use(mediametrics)
|
|
|
|
binder_call(mediametrics, binderservicedomain)
|
|
|
|
binder_service(mediametrics)
|
|
|
|
|
2017-01-19 22:23:52 +01:00
|
|
|
add_service(mediametrics, mediametrics_service)
|
2017-01-24 21:53:45 +01:00
|
|
|
|
|
|
|
allow mediametrics system_server:fd use;
|
|
|
|
|
|
|
|
r_dir_file(mediametrics, cgroup)
|
|
|
|
allow mediametrics proc_meminfo:file r_file_perms;
|
|
|
|
|
2017-03-30 20:37:06 +02:00
|
|
|
# allows interactions with dumpsys to GMScore
|
|
|
|
allow mediametrics app_data_file:file write;
|
|
|
|
|
2017-09-26 21:58:29 +02:00
|
|
|
# allow access to package manager for uid->apk mapping
|
|
|
|
allow mediametrics package_native_service:service_manager find;
|
|
|
|
|
2017-01-24 21:53:45 +01:00
|
|
|
###
|
|
|
|
### neverallow rules
|
|
|
|
###
|
|
|
|
|
|
|
|
# mediametrics should never execute any executable without a
|
|
|
|
# domain transition
|
|
|
|
neverallow mediametrics { file_type fs_type }:file execute_no_trans;
|
|
|
|
|
2017-02-16 21:34:51 +01:00
|
|
|
# The goal of the mediaserver split is to place media processing code into
|
|
|
|
# restrictive sandboxes with limited responsibilities and thus limited
|
|
|
|
# permissions. Example: Audioserver is only responsible for controlling audio
|
|
|
|
# hardware and processing audio content. Cameraserver does the same for camera
|
|
|
|
# hardware/content. Etc.
|
|
|
|
#
|
|
|
|
# Media processing code is inherently risky and thus should have limited
|
|
|
|
# permissions and be isolated from the rest of the system and network.
|
|
|
|
# Lengthier explanation here:
|
|
|
|
# https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
|
2017-01-24 21:53:45 +01:00
|
|
|
neverallow mediametrics domain:{ tcp_socket udp_socket rawip_socket } *;
|