blob: b5bfe39a0a9d21b8ce63fd95d77a467c3c50b30e [file] [log] [blame]
Alex Klyubin238ce792017-02-07 10:47:18 -08001# audioserver - audio services daemon
2
Alex Klyubinf5446eb2017-03-23 14:27:32 -07003typeattribute audioserver coredomain;
4
Alex Klyubin238ce792017-02-07 10:47:18 -08005type audioserver_exec, exec_type, file_type;
dcashmancc39f632016-07-22 13:13:11 -07006init_daemon_domain(audioserver)
Alex Klyubin238ce792017-02-07 10:47:18 -08007
8r_dir_file(audioserver, sdcard_type)
9
10binder_use(audioserver)
11binder_call(audioserver, binderservicedomain)
12binder_call(audioserver, appdomain)
13binder_service(audioserver)
14
Alex Klyubin7cda44f2017-03-21 14:28:53 -070015hal_client_domain(audioserver, hal_allocator)
Alex Klyubin2d704462017-04-10 11:40:53 -070016# /system/lib64/hw for always-passthrough Allocator HAL ashmem / mapper .so
17r_dir_file(audioserver, system_file)
18
Alex Klyubinac2b4cd2017-02-13 14:40:49 -080019hal_client_domain(audioserver, hal_audio)
Alex Klyubin238ce792017-02-07 10:47:18 -080020
Alex Klyubin238ce792017-02-07 10:47:18 -080021userdebug_or_eng(`
22 # used for TEE sink - pcm capture for debug.
23 allow audioserver media_data_file:dir create_dir_perms;
24 allow audioserver audioserver_data_file:dir create_dir_perms;
25 allow audioserver audioserver_data_file:file create_file_perms;
26
27 # ptrace to processes in the same domain for memory leak detection
28 allow audioserver self:process ptrace;
29')
30
Alex Klyubin238ce792017-02-07 10:47:18 -080031add_service(audioserver, audioserver_service)
32allow audioserver appops_service:service_manager find;
33allow audioserver batterystats_service:service_manager find;
34allow audioserver permission_service:service_manager find;
35allow audioserver power_service:service_manager find;
36allow audioserver scheduling_policy_service:service_manager find;
37
38# Grant access to audio files to audioserver
39allow audioserver audio_data_file:dir ra_dir_perms;
40allow audioserver audio_data_file:file create_file_perms;
41
Alex Klyubin238ce792017-02-07 10:47:18 -080042###
43### neverallow rules
44###
45
46# audioserver should never execute any executable without a
47# domain transition
48neverallow audioserver { file_type fs_type }:file execute_no_trans;
49
Nick Kralevich38c12822017-02-16 12:34:51 -080050# The goal of the mediaserver split is to place media processing code into
51# restrictive sandboxes with limited responsibilities and thus limited
52# permissions. Example: Audioserver is only responsible for controlling audio
53# hardware and processing audio content. Cameraserver does the same for camera
54# hardware/content. Etc.
55#
56# Media processing code is inherently risky and thus should have limited
57# permissions and be isolated from the rest of the system and network.
58# Lengthier explanation here:
59# https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
Alex Klyubin238ce792017-02-07 10:47:18 -080060neverallow audioserver domain:{ tcp_socket udp_socket rawip_socket } *;