blob: 9539ff40f3b04f9e3bf6d88e1ae2a4d7cef01983 [file] [log] [blame]
Alex Klyubinac2b4cd2017-02-13 14:40:49 -08001# HwBinder IPC from client to server, and callbacks
2binder_call(hal_audio_client, hal_audio_server)
3binder_call(hal_audio_server, hal_audio_client)
4
Alex Klyubin53656c12017-04-13 19:05:27 -07005add_hwservice(hal_audio_server, hal_audio_hwservice)
6allow hal_audio_client hal_audio_hwservice:hwservice_manager find;
7
Jeff Vander Stoep27ae5452016-10-25 12:42:39 -07008allow hal_audio ion_device:chr_file r_file_perms;
9
Jeff Vander Stoep27ae5452016-10-25 12:42:39 -070010userdebug_or_eng(`
11 # used for pcm capture for debug.
12 allow hal_audio audiohal_data_file:dir create_dir_perms;
13 allow hal_audio audiohal_data_file:file create_file_perms;
14')
15
16r_dir_file(hal_audio, proc)
17allow hal_audio audio_device:dir r_dir_perms;
18allow hal_audio audio_device:chr_file rw_file_perms;
19
Mikhail Naganovd7c88dd2017-03-09 14:32:16 -080020# Needed to provide debug dump output via dumpsys' pipes.
21allow hal_audio shell:fd use;
22allow hal_audio shell:fifo_file write;
23
Jeff Vander Stoep27ae5452016-10-25 12:42:39 -070024# Needed on some devices for playing audio on paired BT device,
25# but seems appropriate for all devices.
26unix_socket_connect(hal_audio, bluetooth, bluetooth)
27
28###
29### neverallow rules
30###
31
Alex Klyubinac2b4cd2017-02-13 14:40:49 -080032# Should never execute any executable without a domain transition
Jeff Vander Stoep27ae5452016-10-25 12:42:39 -070033neverallow hal_audio { file_type fs_type }:file execute_no_trans;
34
Alex Klyubinac2b4cd2017-02-13 14:40:49 -080035# Should never need network access.
Jeff Vander Stoep27ae5452016-10-25 12:42:39 -070036# Disallow network sockets.
37neverallow hal_audio domain:{ tcp_socket udp_socket rawip_socket } *;
Jeff Vander Stoep7fa59c82017-03-13 22:03:10 -070038
39# Only audio HAL may directly access the audio hardware
40neverallow { halserverdomain -hal_audio_server } audio_device:chr_file *;