blob: a6253f244510d053db811d78f96854c4f5c61974 [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 Klyubinac2b4cd2017-02-13 14:40:49 -080015hal_client_domain(audioserver, hal_audio)
Alex Klyubin238ce792017-02-07 10:47:18 -080016
Alex Klyubin238ce792017-02-07 10:47:18 -080017allow audioserver system_file:dir r_dir_perms;
18
19userdebug_or_eng(`
20 # used for TEE sink - pcm capture for debug.
21 allow audioserver media_data_file:dir create_dir_perms;
22 allow audioserver audioserver_data_file:dir create_dir_perms;
23 allow audioserver audioserver_data_file:file create_file_perms;
24
25 # ptrace to processes in the same domain for memory leak detection
26 allow audioserver self:process ptrace;
27')
28
Alex Klyubin238ce792017-02-07 10:47:18 -080029add_service(audioserver, audioserver_service)
30allow audioserver appops_service:service_manager find;
31allow audioserver batterystats_service:service_manager find;
32allow audioserver permission_service:service_manager find;
33allow audioserver power_service:service_manager find;
34allow audioserver scheduling_policy_service:service_manager find;
35
36# Grant access to audio files to audioserver
37allow audioserver audio_data_file:dir ra_dir_perms;
38allow audioserver audio_data_file:file create_file_perms;
39
Alex Klyubin238ce792017-02-07 10:47:18 -080040###
41### neverallow rules
42###
43
44# audioserver should never execute any executable without a
45# domain transition
46neverallow audioserver { file_type fs_type }:file execute_no_trans;
47
Nick Kralevich38c12822017-02-16 12:34:51 -080048# The goal of the mediaserver split is to place media processing code into
49# restrictive sandboxes with limited responsibilities and thus limited
50# permissions. Example: Audioserver is only responsible for controlling audio
51# hardware and processing audio content. Cameraserver does the same for camera
52# hardware/content. Etc.
53#
54# Media processing code is inherently risky and thus should have limited
55# permissions and be isolated from the rest of the system and network.
56# Lengthier explanation here:
57# https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
Alex Klyubin238ce792017-02-07 10:47:18 -080058neverallow audioserver domain:{ tcp_socket udp_socket rawip_socket } *;