xref: /aosp_15_r20/system/sepolicy/private/hal_audio.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1# 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
5hal_attribute_hwservice(hal_audio, hal_audio_hwservice)
6hal_attribute_service(hal_audio, hal_audio_service)
7
8allow hal_audio ion_device:chr_file r_file_perms;
9
10binder_call(hal_audio_server, servicemanager)
11
12r_dir_file(hal_audio, proc)
13r_dir_file(hal_audio, proc_asound)
14allow hal_audio_server audio_device:dir r_dir_perms;
15allow hal_audio_server audio_device:chr_file rw_file_perms;
16
17# Needed to provide debug dump output via dumpsys' pipes.
18allow hal_audio shell:fd use;
19allow hal_audio shell:fifo_file write;
20allow hal_audio dumpstate:fd use;
21allow hal_audio dumpstate:fifo_file write;
22
23# Needed to allow sound trigger hal to access shared memory from apps.
24allow hal_audio_server appdomain:fd use;
25# Allow sound trigger hal to access shared memory from system server.
26allow hal_audio_server system_server_tmpfs:file { getattr map read };
27
28# allow self to set scheduler (and allows Binder RT PI)
29allow hal_audio_server self:global_capability_class_set sys_nice;
30
31# allow hal audio to use vnbinder
32vndbinder_use(hal_audio)
33
34###
35### neverallow rules
36###
37
38# Should never execute any executable without a domain transition
39neverallow hal_audio_server { file_type fs_type }:file execute_no_trans;
40
41# Only audio HAL may directly access the audio hardware
42neverallow { halserverdomain -hal_audio_server -hal_omx_server } audio_device:chr_file *;
43
44get_prop(hal_audio, audio_config_prop)
45get_prop(hal_audio, bluetooth_a2dp_offload_prop)
46get_prop(hal_audio, bluetooth_audio_hal_prop)
47