2012-01-04 18:33:27 +01:00
|
|
|
# mediaserver - multimedia daemon
|
2015-11-03 18:54:39 +01:00
|
|
|
type mediaserver, domain, domain_deprecated;
|
2012-01-04 18:33:27 +01:00
|
|
|
type mediaserver_exec, exec_type, file_type;
|
|
|
|
|
2013-10-23 20:23:43 +02:00
|
|
|
typeattribute mediaserver mlstrustedsubject;
|
|
|
|
|
2012-11-28 21:18:30 +01:00
|
|
|
net_domain(mediaserver)
|
2012-01-04 18:33:27 +01:00
|
|
|
init_daemon_domain(mediaserver)
|
2013-10-23 20:23:43 +02:00
|
|
|
|
|
|
|
r_dir_file(mediaserver, sdcard_type)
|
|
|
|
|
|
|
|
binder_use(mediaserver)
|
|
|
|
binder_call(mediaserver, binderservicedomain)
|
|
|
|
binder_call(mediaserver, appdomain)
|
|
|
|
binder_service(mediaserver)
|
|
|
|
|
2015-09-12 10:35:44 +02:00
|
|
|
# Required by Widevine DRM (b/22990512)
|
2013-10-23 20:23:43 +02:00
|
|
|
allow mediaserver self:process execmem;
|
2015-09-12 10:35:44 +02:00
|
|
|
|
2013-10-23 20:23:43 +02:00
|
|
|
allow mediaserver kernel:system module_request;
|
2014-01-21 21:37:28 +01:00
|
|
|
allow mediaserver media_data_file:dir create_dir_perms;
|
2013-11-04 15:50:52 +01:00
|
|
|
allow mediaserver media_data_file:file create_file_perms;
|
2013-10-23 20:23:43 +02:00
|
|
|
allow mediaserver app_data_file:dir search;
|
|
|
|
allow mediaserver app_data_file:file rw_file_perms;
|
|
|
|
allow mediaserver sdcard_type:file write;
|
2014-05-14 20:04:16 +02:00
|
|
|
allow mediaserver gpu_device:chr_file rw_file_perms;
|
2014-01-06 21:39:19 +01:00
|
|
|
allow mediaserver video_device:dir r_dir_perms;
|
2013-10-23 20:23:43 +02:00
|
|
|
allow mediaserver video_device:chr_file rw_file_perms;
|
|
|
|
allow mediaserver audio_device:dir r_dir_perms;
|
|
|
|
allow mediaserver tee_device:chr_file rw_file_perms;
|
2015-05-05 03:22:45 +02:00
|
|
|
|
|
|
|
set_prop(mediaserver, audio_prop)
|
2013-10-23 20:23:43 +02:00
|
|
|
|
|
|
|
# Access audio devices at all.
|
|
|
|
allow mediaserver audio_device:chr_file rw_file_perms;
|
|
|
|
|
|
|
|
# XXX Label with a specific type?
|
2015-09-22 22:03:41 +02:00
|
|
|
allow mediaserver sysfs:file r_file_perms;
|
2013-10-23 20:23:43 +02:00
|
|
|
|
2014-03-13 20:35:46 +01:00
|
|
|
# Read resources from open apk files passed over Binder.
|
2014-02-04 17:36:41 +01:00
|
|
|
allow mediaserver apk_data_file:file { read getattr };
|
2014-03-13 20:35:46 +01:00
|
|
|
allow mediaserver asec_apk_file:file { read getattr };
|
2013-10-23 20:23:43 +02:00
|
|
|
|
2014-03-27 14:45:26 +01:00
|
|
|
# Read /data/data/com.android.providers.telephony files passed over Binder.
|
|
|
|
allow mediaserver radio_data_file:file { read getattr };
|
|
|
|
|
2014-05-13 14:07:31 +02:00
|
|
|
# Use pipes passed over Binder from app domains.
|
|
|
|
allow mediaserver appdomain:fifo_file { getattr read write };
|
|
|
|
|
2013-10-23 20:23:43 +02:00
|
|
|
allow mediaserver rpmsg_device:chr_file rw_file_perms;
|
|
|
|
|
|
|
|
# Inter System processes communicate over named pipe (FIFO)
|
|
|
|
allow mediaserver system_server:fifo_file r_file_perms;
|
|
|
|
|
2013-11-07 19:42:46 +01:00
|
|
|
# Camera data
|
2014-01-06 21:39:19 +01:00
|
|
|
r_dir_file(mediaserver, camera_data_file)
|
|
|
|
r_dir_file(mediaserver, media_rw_data_file)
|
2013-10-23 20:23:43 +02:00
|
|
|
|
2013-11-07 19:42:46 +01:00
|
|
|
# Grant access to audio files to mediaserver
|
|
|
|
allow mediaserver audio_data_file:dir ra_dir_perms;
|
|
|
|
allow mediaserver audio_data_file:file create_file_perms;
|
2013-11-06 19:00:52 +01:00
|
|
|
|
2013-10-23 20:23:43 +02:00
|
|
|
# Read/[write] to /proc/net/xt_qtaguid/ctrl and /dev/xt_qtaguid
|
|
|
|
allow mediaserver qtaguid_proc:file rw_file_perms;
|
|
|
|
allow mediaserver qtaguid_device:chr_file r_file_perms;
|
|
|
|
|
|
|
|
# Allow abstract socket connection
|
|
|
|
allow mediaserver rild:unix_stream_socket { connectto read write setopt };
|
2014-01-08 20:19:52 +01:00
|
|
|
|
|
|
|
# Needed on some devices for playing DRM protected content,
|
|
|
|
# but seems expected and appropriate for all devices.
|
|
|
|
unix_socket_connect(mediaserver, drmserver, drmserver)
|
2014-01-13 15:14:15 +01:00
|
|
|
|
|
|
|
# Needed on some devices for playing audio on paired BT device,
|
|
|
|
# but seems appropriate for all devices.
|
|
|
|
unix_socket_connect(mediaserver, bluetooth, bluetooth)
|
2014-03-06 21:00:59 +01:00
|
|
|
|
|
|
|
# Connect to tee service.
|
|
|
|
allow mediaserver tee:unix_stream_socket connectto;
|
2014-06-06 00:52:02 +02:00
|
|
|
|
2015-04-03 23:24:02 +02:00
|
|
|
allow mediaserver activity_service:service_manager find;
|
|
|
|
allow mediaserver appops_service:service_manager find;
|
2015-05-20 02:26:31 +02:00
|
|
|
allow mediaserver cameraproxy_service:service_manager find;
|
2015-04-04 01:11:01 +02:00
|
|
|
allow mediaserver batterystats_service:service_manager find;
|
2014-12-12 01:01:27 +01:00
|
|
|
allow mediaserver drmserver_service:service_manager find;
|
|
|
|
allow mediaserver mediaserver_service:service_manager { add find };
|
2015-04-08 22:04:59 +02:00
|
|
|
allow mediaserver permission_service:service_manager find;
|
|
|
|
allow mediaserver power_service:service_manager find;
|
|
|
|
allow mediaserver processinfo_service:service_manager find;
|
2015-04-09 00:12:24 +02:00
|
|
|
allow mediaserver scheduling_policy_service:service_manager find;
|
2014-12-12 01:01:27 +01:00
|
|
|
allow mediaserver surfaceflinger_service:service_manager find;
|
2014-07-07 22:56:27 +02:00
|
|
|
|
2014-09-16 19:00:50 +02:00
|
|
|
# /oem access
|
2014-10-11 01:11:03 +02:00
|
|
|
allow mediaserver oemfs:dir search;
|
2014-09-16 19:00:50 +02:00
|
|
|
allow mediaserver oemfs:file r_file_perms;
|
2014-09-16 22:04:06 +02:00
|
|
|
|
2014-07-02 21:42:59 +02:00
|
|
|
use_drmservice(mediaserver)
|
|
|
|
allow mediaserver drmserver:drmservice {
|
|
|
|
consumeRights
|
|
|
|
setPlaybackStatus
|
|
|
|
openDecryptSession
|
|
|
|
closeDecryptSession
|
|
|
|
initializeDecryptUnit
|
|
|
|
decrypt
|
|
|
|
finalizeDecryptUnit
|
|
|
|
pread
|
|
|
|
};
|
2015-08-14 07:33:49 +02:00
|
|
|
|
|
|
|
###
|
|
|
|
### neverallow rules
|
|
|
|
###
|
|
|
|
|
|
|
|
# mediaserver should never execute any executable without a
|
|
|
|
# domain transition
|
|
|
|
neverallow mediaserver { file_type fs_type }:file execute_no_trans;
|