Zvikomborero VIncent Zvikaramba | a25011a | 2016-07-21 16:32:35 -0400 | [diff] [blame] | 1 | # Bluetooth executables and scripts |
| 2 | type bluetooth_loader, domain; |
| 3 | type bluetooth_loader_exec, exec_type, file_type; |
| 4 | |
| 5 | # Start bdAddrLoader from init |
| 6 | init_daemon_domain(bluetooth_loader) |
| 7 | |
| 8 | # Run init.qcom.bt.sh |
| 9 | allow bluetooth_loader shell_exec:file { entrypoint read }; |
| 10 | allow bluetooth_loader bluetooth_loader_exec:file { getattr open execute_no_trans }; |
| 11 | |
| 12 | # init.qcom.bt.sh needs /system/bin/log access |
| 13 | allow bluetooth_loader devpts:chr_file rw_file_perms; |
| 14 | |
| 15 | # Run hci_qcomm_init from init.qcom.bt.sh |
| 16 | domain_auto_trans(bluetooth_loader, hci_attach_exec, hci_attach) |
| 17 | allow hci_attach bluetooth_loader:fd use; |
| 18 | |
| 19 | # Read mac address from persist partition |
| 20 | allow bluetooth_loader persist_file:dir search; |
Zvikomborero VIncent Zvikaramba | a750128 | 2016-08-19 02:18:23 -0400 | [diff] [blame] | 21 | allow bluetooth_loader efs_file:dir search; |
| 22 | allow bluetooth_loader bluetooth_efs_file:dir search; |
| 23 | allow bluetooth_loader bluetooth_efs_file:file { open read }; |
Zvikomborero VIncent Zvikaramba | a25011a | 2016-07-21 16:32:35 -0400 | [diff] [blame] | 24 | r_dir_file(bluetooth_loader, bluetooth_data_file) |
| 25 | allow bluetooth_loader self:capability { dac_override dac_read_search chown }; |
| 26 | |
| 27 | # It may write a random mac here |
Zvikomborero VIncent Zvikaramba | a750128 | 2016-08-19 02:18:23 -0400 | [diff] [blame] | 28 | #allow bluetooth_loader persist_file:dir { add_name write }; |
| 29 | #allow bluetooth_loader persist_file:file { create_file_perms }; |
Zvikomborero VIncent Zvikaramba | a25011a | 2016-07-21 16:32:35 -0400 | [diff] [blame] | 30 | |
| 31 | # Talk to init over the property socket |
| 32 | unix_socket_connect(bluetooth_loader, property, init) |
| 33 | # Set persist.service.bdroid.* and bluetooth.* property values |
| 34 | allow bluetooth_loader bluetooth_prop:property_service set; |
| 35 | |
| 36 | # Allow getprop/setprop for init.qcom.bt.sh |
| 37 | allow bluetooth_loader system_file:file execute_no_trans; |
| 38 | |
| 39 | # Access the smd device |
| 40 | allow bluetooth_loader hci_attach_dev:chr_file rw_file_perms; |
| 41 | |
| 42 | # And qmuxd |
| 43 | allow bluetooth_loader qmuxd_socket:dir { write add_name remove_name search }; |
| 44 | allow bluetooth_loader qmuxd_socket:sock_file { create setattr getattr write unlink }; |
| 45 | allow bluetooth_loader qmuxd:unix_stream_socket { connectto }; |
| 46 | # |