blob: 95a752169c29b52077ff61e8acfb6481d0473237 [file] [log] [blame]
Alex Klyubin238ce792017-02-07 10:47:18 -08001# audioserver - audio services daemon
2
3type audioserver_exec, exec_type, file_type;
dcashmancc39f632016-07-22 13:13:11 -07004init_daemon_domain(audioserver)
Alex Klyubin238ce792017-02-07 10:47:18 -08005
6r_dir_file(audioserver, sdcard_type)
7
8binder_use(audioserver)
9binder_call(audioserver, binderservicedomain)
10binder_call(audioserver, appdomain)
11binder_service(audioserver)
12
Alex Klyubinac2b4cd2017-02-13 14:40:49 -080013hal_client_domain(audioserver, hal_audio)
Alex Klyubin238ce792017-02-07 10:47:18 -080014
Alex Klyubin238ce792017-02-07 10:47:18 -080015allow audioserver system_file:dir r_dir_perms;
16
17userdebug_or_eng(`
18 # used for TEE sink - pcm capture for debug.
19 allow audioserver media_data_file:dir create_dir_perms;
20 allow audioserver audioserver_data_file:dir create_dir_perms;
21 allow audioserver audioserver_data_file:file create_file_perms;
22
23 # ptrace to processes in the same domain for memory leak detection
24 allow audioserver self:process ptrace;
25')
26
Alex Klyubin238ce792017-02-07 10:47:18 -080027add_service(audioserver, audioserver_service)
28allow audioserver appops_service:service_manager find;
29allow audioserver batterystats_service:service_manager find;
30allow audioserver permission_service:service_manager find;
31allow audioserver power_service:service_manager find;
32allow audioserver scheduling_policy_service:service_manager find;
33
34# Grant access to audio files to audioserver
35allow audioserver audio_data_file:dir ra_dir_perms;
36allow audioserver audio_data_file:file create_file_perms;
37
Alex Klyubin238ce792017-02-07 10:47:18 -080038###
39### neverallow rules
40###
41
42# audioserver should never execute any executable without a
43# domain transition
44neverallow audioserver { file_type fs_type }:file execute_no_trans;
45
Nick Kralevich38c12822017-02-16 12:34:51 -080046# The goal of the mediaserver split is to place media processing code into
47# restrictive sandboxes with limited responsibilities and thus limited
48# permissions. Example: Audioserver is only responsible for controlling audio
49# hardware and processing audio content. Cameraserver does the same for camera
50# hardware/content. Etc.
51#
52# Media processing code is inherently risky and thus should have limited
53# permissions and be isolated from the rest of the system and network.
54# Lengthier explanation here:
55# https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
Alex Klyubin238ce792017-02-07 10:47:18 -080056neverallow audioserver domain:{ tcp_socket udp_socket rawip_socket } *;