2012-11-16 06:06:47 -08:00
|
|
|
# bluetooth subsystem
|
2015-11-03 09:54:39 -08:00
|
|
|
type bluetooth, domain, domain_deprecated;
|
2012-11-16 06:06:47 -08:00
|
|
|
app_domain(bluetooth)
|
2014-02-24 07:48:03 -08:00
|
|
|
net_domain(bluetooth)
|
2013-10-22 09:56:32 -07:00
|
|
|
|
|
|
|
# Data file accesses.
|
|
|
|
allow bluetooth bluetooth_data_file:dir create_dir_perms;
|
|
|
|
allow bluetooth bluetooth_data_file:notdevfile_class_set create_file_perms;
|
|
|
|
|
2014-01-13 06:14:15 -08:00
|
|
|
# Socket creation under /data/misc/bluedroid.
|
|
|
|
type_transition bluetooth bluetooth_data_file:sock_file bluetooth_socket;
|
|
|
|
allow bluetooth bluetooth_socket:sock_file create_file_perms;
|
|
|
|
|
2013-10-22 09:56:32 -07:00
|
|
|
# bluetooth factory file accesses.
|
|
|
|
r_dir_file(bluetooth, bluetooth_efs_file)
|
|
|
|
|
2015-10-06 09:11:02 -07:00
|
|
|
# TODO why does bluetooth require access to tun_device? If not,
|
|
|
|
# remove access and tighten down neverallow rule so that appdomain is
|
|
|
|
# not allowed to open (as opposed to just untrusted_app)
|
|
|
|
# Device accesses. b/24744295
|
2013-10-23 10:50:19 -07:00
|
|
|
allow bluetooth { tun_device uhid_device hci_attach_dev }:chr_file rw_file_perms;
|
2015-10-06 09:11:02 -07:00
|
|
|
auditallow bluetooth tun_device:chr_file rw_file_perms;
|
2013-10-22 09:56:32 -07:00
|
|
|
|
|
|
|
# sysfs access.
|
|
|
|
allow bluetooth sysfs_bluetooth_writable:file rw_file_perms;
|
|
|
|
allow bluetooth self:capability net_admin;
|
2014-06-29 10:45:03 -07:00
|
|
|
allow bluetooth self:capability2 wake_alarm;
|
2013-10-22 09:56:32 -07:00
|
|
|
|
|
|
|
# tethering
|
2014-02-24 12:06:11 -08:00
|
|
|
allow bluetooth self:tun_socket create_socket_perms;
|
2013-10-22 09:56:32 -07:00
|
|
|
allow bluetooth efs_file:dir search;
|
|
|
|
|
|
|
|
# proc access.
|
|
|
|
allow bluetooth proc_bluetooth_writable:file rw_file_perms;
|
|
|
|
|
2013-10-29 12:45:10 -07:00
|
|
|
# Allow write access to bluetooth specific properties
|
2015-05-04 18:22:45 -07:00
|
|
|
set_prop(bluetooth, bluetooth_prop)
|
|
|
|
set_prop(bluetooth, pan_result_prop)
|
|
|
|
set_prop(bluetooth, ctl_dhcp_pan_prop)
|
2013-10-29 12:45:10 -07:00
|
|
|
|
2014-12-11 16:01:27 -08:00
|
|
|
allow bluetooth bluetooth_service:service_manager find;
|
2015-10-07 05:42:37 -07:00
|
|
|
allow bluetooth drmserver_service:service_manager find;
|
2015-02-11 13:25:57 -08:00
|
|
|
allow bluetooth mediaserver_service:service_manager find;
|
2014-12-11 16:01:27 -08:00
|
|
|
allow bluetooth radio_service:service_manager find;
|
2015-02-12 09:50:20 -08:00
|
|
|
allow bluetooth surfaceflinger_service:service_manager find;
|
2015-04-02 16:50:08 -07:00
|
|
|
allow bluetooth app_api_service:service_manager find;
|
|
|
|
allow bluetooth system_api_service:service_manager find;
|
2014-07-07 13:56:27 -07:00
|
|
|
|
2015-03-19 02:56:26 -07:00
|
|
|
# Bluetooth Sim Access Profile Socket to the RIL
|
|
|
|
unix_socket_connect(bluetooth, sap_uim, rild)
|
|
|
|
|
2014-12-19 16:43:41 -08:00
|
|
|
# already open bugreport file descriptors may be shared with
|
|
|
|
# the bluetooth process, from a file in
|
|
|
|
# /data/data/com.android.shell/files/bugreports/bugreport-*.
|
|
|
|
allow bluetooth shell_data_file:file read;
|
|
|
|
|
2013-10-22 09:56:32 -07:00
|
|
|
###
|
|
|
|
### Neverallow rules
|
|
|
|
###
|
|
|
|
### These are things that the bluetooth app should NEVER be able to do
|
|
|
|
###
|
|
|
|
|
|
|
|
# Superuser capabilities.
|
2014-06-29 10:45:03 -07:00
|
|
|
# bluetooth requires net_admin and wake_alarm.
|
2014-07-04 10:12:13 -07:00
|
|
|
neverallow bluetooth self:capability ~net_admin;
|
|
|
|
neverallow bluetooth self:capability2 ~wake_alarm;
|