2017-02-07 19:47:18 +01:00
|
|
|
# audioserver - audio services daemon
|
|
|
|
|
2017-03-23 22:27:32 +01:00
|
|
|
typeattribute audioserver coredomain;
|
|
|
|
|
2017-02-07 19:47:18 +01:00
|
|
|
type audioserver_exec, exec_type, file_type;
|
2016-07-22 22:13:11 +02:00
|
|
|
init_daemon_domain(audioserver)
|
2017-02-07 19:47:18 +01:00
|
|
|
|
|
|
|
r_dir_file(audioserver, sdcard_type)
|
|
|
|
|
|
|
|
binder_use(audioserver)
|
|
|
|
binder_call(audioserver, binderservicedomain)
|
|
|
|
binder_call(audioserver, appdomain)
|
|
|
|
binder_service(audioserver)
|
|
|
|
|
2017-02-13 23:40:49 +01:00
|
|
|
hal_client_domain(audioserver, hal_audio)
|
2017-02-07 19:47:18 +01:00
|
|
|
|
|
|
|
allow audioserver system_file:dir r_dir_perms;
|
|
|
|
|
|
|
|
userdebug_or_eng(`
|
|
|
|
# used for TEE sink - pcm capture for debug.
|
|
|
|
allow audioserver media_data_file:dir create_dir_perms;
|
|
|
|
allow audioserver audioserver_data_file:dir create_dir_perms;
|
|
|
|
allow audioserver audioserver_data_file:file create_file_perms;
|
|
|
|
|
|
|
|
# ptrace to processes in the same domain for memory leak detection
|
|
|
|
allow audioserver self:process ptrace;
|
|
|
|
')
|
|
|
|
|
|
|
|
add_service(audioserver, audioserver_service)
|
|
|
|
allow audioserver appops_service:service_manager find;
|
|
|
|
allow audioserver batterystats_service:service_manager find;
|
|
|
|
allow audioserver permission_service:service_manager find;
|
|
|
|
allow audioserver power_service:service_manager find;
|
|
|
|
allow audioserver scheduling_policy_service:service_manager find;
|
|
|
|
|
|
|
|
# Grant access to audio files to audioserver
|
|
|
|
allow audioserver audio_data_file:dir ra_dir_perms;
|
|
|
|
allow audioserver audio_data_file:file create_file_perms;
|
|
|
|
|
|
|
|
###
|
|
|
|
### neverallow rules
|
|
|
|
###
|
|
|
|
|
|
|
|
# audioserver should never execute any executable without a
|
|
|
|
# domain transition
|
|
|
|
neverallow audioserver { 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-02-07 19:47:18 +01:00
|
|
|
neverallow audioserver domain:{ tcp_socket udp_socket rawip_socket } *;
|