2012-11-16 06:06:47 -08:00
|
|
|
# bluetooth subsystem
|
2015-11-03 09:54:39 -08:00
|
|
|
type bluetooth, domain, domain_deprecated;
|
2016-12-08 11:23:34 -08:00
|
|
|
|
2014-02-24 07:48:03 -08:00
|
|
|
net_domain(bluetooth)
|
2016-05-16 21:12:17 -07:00
|
|
|
# Allow access to net_admin ioctls
|
|
|
|
allowxperm bluetooth self:udp_socket ioctl priv_sock_ioctls;
|
2013-10-22 09:56:32 -07:00
|
|
|
|
2015-12-28 16:54:53 -08:00
|
|
|
wakelock_use(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;
|
2016-09-16 12:55:42 -07:00
|
|
|
allow bluetooth bluetooth_logs_data_file:dir rw_dir_perms;
|
|
|
|
allow bluetooth bluetooth_logs_data_file:file create_file_perms;
|
2013-10-22 09:56:32 -07:00
|
|
|
|
2014-01-13 06:14:15 -08:00
|
|
|
# Socket creation under /data/misc/bluedroid.
|
|
|
|
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-12-03 15:56:04 -08:00
|
|
|
allow bluetooth { uhid_device hci_attach_dev }:chr_file rw_file_perms;
|
2013-10-22 09:56:32 -07:00
|
|
|
|
|
|
|
# sysfs access.
|
2016-09-09 16:27:17 -07:00
|
|
|
r_dir_file(bluetooth, sysfs_type)
|
2013-10-22 09:56:32 -07:00
|
|
|
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
|
2016-05-16 21:12:17 -07:00
|
|
|
allow bluetooth self:packet_socket create_socket_perms_no_ioctl;
|
2016-02-18 03:52:22 -08:00
|
|
|
allow bluetooth self:capability { net_admin net_raw net_bind_service };
|
2016-05-16 21:12:17 -07:00
|
|
|
allow bluetooth self:tun_socket create_socket_perms_no_ioctl;
|
2016-02-28 20:52:55 -08:00
|
|
|
allow bluetooth tun_device:chr_file rw_file_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)
|
2013-10-29 12:45:10 -07:00
|
|
|
|
2015-09-09 10:48:04 -07:00
|
|
|
allow bluetooth audioserver_service:service_manager find;
|
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.
|
2016-02-18 03:52:22 -08:00
|
|
|
# bluetooth requires net_{admin,raw,bind_service} and wake_alarm and block_suspend.
|
|
|
|
neverallow bluetooth self:capability ~{ net_admin net_raw net_bind_service };
|
2015-12-28 16:54:53 -08:00
|
|
|
neverallow bluetooth self:capability2 ~{ wake_alarm block_suspend };
|