blob: aabc884f86fdfdfcb6e8d8e2993f3f0931797547 [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
Steven Moreland9234e002018-06-06 09:30:18 -07005hal_attribute_hwservice(hal_audio, hal_audio_hwservice)
Ytai Ben-Tsvi9eaf3be2021-03-22 13:00:38 -07006hal_attribute_service(hal_audio, hal_audio_service)
Alex Klyubin53656c12017-04-13 19:05:27 -07007
Jeff Vander Stoep27ae5452016-10-25 12:42:39 -07008allow hal_audio ion_device:chr_file r_file_perms;
9
Mikhail Naganov676da722021-12-03 19:24:28 +000010binder_call(hal_audio_server, servicemanager)
11
Mikhail Naganov80483852017-10-18 20:28:33 +000012r_dir_file(hal_audio, proc)
Tri Vo464f59a2017-10-06 10:20:53 -070013r_dir_file(hal_audio, proc_asound)
Sunny Kapdibc0c88f2017-10-30 12:58:20 -070014allow hal_audio_server audio_device:dir r_dir_perms;
15allow hal_audio_server audio_device:chr_file rw_file_perms;
Jeff Vander Stoep27ae5452016-10-25 12:42:39 -070016
Mikhail Naganovd7c88dd2017-03-09 14:32:16 -080017# Needed to provide debug dump output via dumpsys' pipes.
18allow hal_audio shell:fd use;
19allow hal_audio shell:fifo_file write;
Mikhail Naganov9686cbc2017-05-04 13:25:52 -070020allow hal_audio dumpstate:fd use;
21allow hal_audio dumpstate:fifo_file write;
Mikhail Naganovd7c88dd2017-03-09 14:32:16 -080022
Ytai Ben-Tsvid09bf562020-03-26 16:00:51 -070023# Needed to allow sound trigger hal to access shared memory from apps.
24allow hal_audio_server appdomain:fd use;
25
Andy Hunga8b69002022-12-01 13:45:09 -080026# allow self to set scheduler (and allows Binder RT PI)
27allow hal_audio_server self:global_capability_class_set sys_nice;
28
Haynes Mathew Georgeebc7b432018-02-27 16:21:27 -080029# allow hal audio to use vnbinder
30vndbinder_use(hal_audio)
31
Jeff Vander Stoep27ae5452016-10-25 12:42:39 -070032###
33### neverallow rules
34###
35
Alex Klyubinac2b4cd2017-02-13 14:40:49 -080036# Should never execute any executable without a domain transition
Jeff Vander Stoep6a28b682017-11-20 21:43:25 -080037neverallow hal_audio_server { file_type fs_type }:file execute_no_trans;
Jeff Vander Stoep27ae5452016-10-25 12:42:39 -070038
Jeff Vander Stoep7fa59c82017-03-13 22:03:10 -070039# Only audio HAL may directly access the audio hardware
Vignesh Kulothungan155ca122019-03-18 17:21:17 -070040neverallow { halserverdomain -hal_audio_server -hal_omx_server } audio_device:chr_file *;
Jaekyun Seok224921d2018-04-09 12:07:32 +090041
Inseob Kimebde47c2020-06-23 23:52:55 +090042get_prop(hal_audio, audio_config_prop)
Jaekyun Seok224921d2018-04-09 12:07:32 +090043get_prop(hal_audio, bluetooth_a2dp_offload_prop)
Cheney Nie55a74b2019-03-18 11:07:32 +080044get_prop(hal_audio, bluetooth_audio_hal_prop)