2012-11-16 15:06:47 +01:00
|
|
|
# bluetooth subsystem
|
2015-11-03 18:54:39 +01:00
|
|
|
type bluetooth, domain, domain_deprecated;
|
2012-11-16 15:06:47 +01:00
|
|
|
app_domain(bluetooth)
|
2014-02-24 16:48:03 +01:00
|
|
|
net_domain(bluetooth)
|
2013-10-22 18:56:32 +02:00
|
|
|
|
2015-09-01 08:28:15 +02:00
|
|
|
wakelock_use(bluetooth);
|
|
|
|
|
2013-10-22 18:56:32 +02: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 15:14:15 +01: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 18:56:32 +02:00
|
|
|
# bluetooth factory file accesses.
|
|
|
|
r_dir_file(bluetooth, bluetooth_efs_file)
|
|
|
|
|
2015-12-04 00:56:04 +01:00
|
|
|
allow bluetooth { uhid_device hci_attach_dev }:chr_file rw_file_perms;
|
2013-10-22 18:56:32 +02:00
|
|
|
|
|
|
|
# sysfs access.
|
|
|
|
allow bluetooth sysfs_bluetooth_writable:file rw_file_perms;
|
|
|
|
allow bluetooth self:capability net_admin;
|
2014-06-29 19:45:03 +02:00
|
|
|
allow bluetooth self:capability2 wake_alarm;
|
2013-10-22 18:56:32 +02:00
|
|
|
|
|
|
|
# tethering
|
2014-02-24 21:06:11 +01:00
|
|
|
allow bluetooth self:tun_socket create_socket_perms;
|
2013-10-22 18:56:32 +02:00
|
|
|
allow bluetooth efs_file:dir search;
|
|
|
|
|
|
|
|
# proc access.
|
|
|
|
allow bluetooth proc_bluetooth_writable:file rw_file_perms;
|
|
|
|
|
2013-10-29 20:45:10 +01:00
|
|
|
# Allow write access to bluetooth specific properties
|
2015-05-05 03:22:45 +02:00
|
|
|
set_prop(bluetooth, bluetooth_prop)
|
|
|
|
set_prop(bluetooth, pan_result_prop)
|
|
|
|
set_prop(bluetooth, ctl_dhcp_pan_prop)
|
2013-10-29 20:45:10 +01:00
|
|
|
|
2014-12-12 01:01:27 +01:00
|
|
|
allow bluetooth bluetooth_service:service_manager find;
|
2015-10-07 14:42:37 +02:00
|
|
|
allow bluetooth drmserver_service:service_manager find;
|
2015-02-11 22:25:57 +01:00
|
|
|
allow bluetooth mediaserver_service:service_manager find;
|
2014-12-12 01:01:27 +01:00
|
|
|
allow bluetooth radio_service:service_manager find;
|
2015-02-12 18:50:20 +01:00
|
|
|
allow bluetooth surfaceflinger_service:service_manager find;
|
2015-04-03 01:50:08 +02:00
|
|
|
allow bluetooth app_api_service:service_manager find;
|
|
|
|
allow bluetooth system_api_service:service_manager find;
|
2014-07-07 22:56:27 +02:00
|
|
|
|
2015-03-19 10:56:26 +01:00
|
|
|
# Bluetooth Sim Access Profile Socket to the RIL
|
|
|
|
unix_socket_connect(bluetooth, sap_uim, rild)
|
|
|
|
|
2014-12-20 01:43:41 +01: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 18:56:32 +02:00
|
|
|
###
|
|
|
|
### Neverallow rules
|
|
|
|
###
|
|
|
|
### These are things that the bluetooth app should NEVER be able to do
|
|
|
|
###
|
|
|
|
|
|
|
|
# Superuser capabilities.
|
2014-06-29 19:45:03 +02:00
|
|
|
# bluetooth requires net_admin and wake_alarm.
|
2014-07-04 19:12:13 +02:00
|
|
|
neverallow bluetooth self:capability ~net_admin;
|
2015-09-01 08:28:15 +02:00
|
|
|
neverallow bluetooth self:capability2 ~{ wake_alarm block_suspend };
|