Alex Klyubin | ac2b4cd | 2017-02-13 14:40:49 -0800 | [diff] [blame] | 1 | # HwBinder IPC from client to server, and callbacks |
| 2 | binder_call(hal_audio_client, hal_audio_server) |
| 3 | binder_call(hal_audio_server, hal_audio_client) |
| 4 | |
Alex Klyubin | 53656c1 | 2017-04-13 19:05:27 -0700 | [diff] [blame] | 5 | add_hwservice(hal_audio_server, hal_audio_hwservice) |
| 6 | allow hal_audio_client hal_audio_hwservice:hwservice_manager find; |
| 7 | |
Jeff Vander Stoep | 27ae545 | 2016-10-25 12:42:39 -0700 | [diff] [blame] | 8 | allow hal_audio ion_device:chr_file r_file_perms; |
| 9 | |
Mikhail Naganov | 8048385 | 2017-10-18 20:28:33 +0000 | [diff] [blame] | 10 | r_dir_file(hal_audio, proc) |
Tri Vo | 464f59a | 2017-10-06 10:20:53 -0700 | [diff] [blame] | 11 | r_dir_file(hal_audio, proc_asound) |
Jeff Vander Stoep | 27ae545 | 2016-10-25 12:42:39 -0700 | [diff] [blame] | 12 | allow hal_audio audio_device:dir r_dir_perms; |
| 13 | allow hal_audio audio_device:chr_file rw_file_perms; |
| 14 | |
Mikhail Naganov | d7c88dd | 2017-03-09 14:32:16 -0800 | [diff] [blame] | 15 | # Needed to provide debug dump output via dumpsys' pipes. |
| 16 | allow hal_audio shell:fd use; |
| 17 | allow hal_audio shell:fifo_file write; |
Mikhail Naganov | 9686cbc | 2017-05-04 13:25:52 -0700 | [diff] [blame] | 18 | allow hal_audio dumpstate:fd use; |
| 19 | allow hal_audio dumpstate:fifo_file write; |
Mikhail Naganov | d7c88dd | 2017-03-09 14:32:16 -0800 | [diff] [blame] | 20 | |
Jeff Vander Stoep | 27ae545 | 2016-10-25 12:42:39 -0700 | [diff] [blame] | 21 | ### |
| 22 | ### neverallow rules |
| 23 | ### |
| 24 | |
Alex Klyubin | ac2b4cd | 2017-02-13 14:40:49 -0800 | [diff] [blame] | 25 | # Should never execute any executable without a domain transition |
Jeff Vander Stoep | 6a28b68 | 2017-11-20 21:43:25 -0800 | [diff] [blame^] | 26 | neverallow hal_audio_server { file_type fs_type }:file execute_no_trans; |
Jeff Vander Stoep | 27ae545 | 2016-10-25 12:42:39 -0700 | [diff] [blame] | 27 | |
Alex Klyubin | ac2b4cd | 2017-02-13 14:40:49 -0800 | [diff] [blame] | 28 | # Should never need network access. |
Jeff Vander Stoep | 27ae545 | 2016-10-25 12:42:39 -0700 | [diff] [blame] | 29 | # Disallow network sockets. |
Jeff Vander Stoep | 6a28b68 | 2017-11-20 21:43:25 -0800 | [diff] [blame^] | 30 | neverallow hal_audio_server domain:{ tcp_socket udp_socket rawip_socket } *; |
Jeff Vander Stoep | 7fa59c8 | 2017-03-13 22:03:10 -0700 | [diff] [blame] | 31 | |
| 32 | # Only audio HAL may directly access the audio hardware |
| 33 | neverallow { halserverdomain -hal_audio_server } audio_device:chr_file *; |