2015-09-09 19:48:04 +02:00
|
|
|
# audioserver - audio services daemon
|
2016-02-09 21:12:13 +01:00
|
|
|
type audioserver, domain;
|
2015-09-09 19:48:04 +02:00
|
|
|
type audioserver_exec, exec_type, file_type;
|
|
|
|
|
|
|
|
r_dir_file(audioserver, sdcard_type)
|
|
|
|
|
|
|
|
binder_use(audioserver)
|
|
|
|
binder_call(audioserver, binderservicedomain)
|
2016-10-06 22:15:44 +02:00
|
|
|
binder_call(audioserver, { appdomain ephemeral_app })
|
2015-09-09 19:48:04 +02:00
|
|
|
binder_service(audioserver)
|
|
|
|
|
2016-08-04 22:40:23 +02:00
|
|
|
hwbinder_use(audioserver)
|
2016-10-25 21:42:39 +02:00
|
|
|
binder_call(audioserver, hal_audio)
|
2016-08-04 22:40:23 +02:00
|
|
|
|
2016-01-27 18:37:18 +01:00
|
|
|
r_dir_file(audioserver, proc)
|
2016-02-09 21:12:13 +01:00
|
|
|
allow audioserver ion_device:chr_file r_file_perms;
|
|
|
|
allow audioserver system_file:dir r_dir_perms;
|
2016-01-27 18:37:18 +01:00
|
|
|
|
2016-02-09 21:12:13 +01:00
|
|
|
userdebug_or_eng(`
|
2016-04-13 23:27:22 +02:00
|
|
|
# used for TEE sink - pcm capture for debug.
|
2016-02-09 21:12:13 +01:00
|
|
|
allow audioserver media_data_file:dir create_dir_perms;
|
2016-02-24 01:16:16 +01:00
|
|
|
allow audioserver audioserver_data_file:dir create_dir_perms;
|
|
|
|
allow audioserver audioserver_data_file:file create_file_perms;
|
2016-04-13 23:27:22 +02:00
|
|
|
|
|
|
|
# ptrace to processes in the same domain for memory leak detection
|
|
|
|
allow audioserver self:process ptrace;
|
2016-02-09 21:12:13 +01:00
|
|
|
')
|
2015-09-09 19:48:04 +02:00
|
|
|
|
|
|
|
allow audioserver audio_device:dir r_dir_perms;
|
|
|
|
allow audioserver audio_device:chr_file rw_file_perms;
|
|
|
|
|
2016-02-09 21:12:13 +01:00
|
|
|
allow audioserver audioserver_service:service_manager { add find };
|
|
|
|
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;
|
2015-09-09 19:48:04 +02:00
|
|
|
|
|
|
|
# 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;
|
|
|
|
|
|
|
|
# Needed on some devices for playing audio on paired BT device,
|
|
|
|
# but seems appropriate for all devices.
|
|
|
|
unix_socket_connect(audioserver, bluetooth, bluetooth)
|
|
|
|
|
|
|
|
###
|
|
|
|
### neverallow rules
|
|
|
|
###
|
|
|
|
|
|
|
|
# audioserver should never execute any executable without a
|
|
|
|
# domain transition
|
|
|
|
neverallow audioserver { file_type fs_type }:file execute_no_trans;
|
2016-01-06 20:32:07 +01:00
|
|
|
|
2016-04-23 00:34:40 +02:00
|
|
|
# audioserver should never need network access. Disallow network sockets.
|
|
|
|
neverallow audioserver domain:{ tcp_socket udp_socket rawip_socket } *;
|