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)
|
2016-05-17 06:12:17 +02:00
|
|
|
# Allow access to net_admin ioctls
|
|
|
|
allowxperm bluetooth self:udp_socket ioctl priv_sock_ioctls;
|
2013-10-22 18:56:32 +02:00
|
|
|
|
2015-12-29 01:54:53 +01: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;
|
2016-09-16 21:55:42 +02:00
|
|
|
allow bluetooth bluetooth_logs_data_file:dir rw_dir_perms;
|
|
|
|
allow bluetooth bluetooth_logs_data_file:file create_file_perms;
|
2013-10-22 18:56:32 +02:00
|
|
|
|
2014-01-13 15:14:15 +01:00
|
|
|
# Socket creation under /data/misc/bluedroid.
|
|
|
|
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.
|
2016-09-10 01:27:17 +02:00
|
|
|
r_dir_file(bluetooth, sysfs_type)
|
2013-10-22 18:56:32 +02:00
|
|
|
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
|
2016-05-17 06:12:17 +02:00
|
|
|
allow bluetooth self:packet_socket create_socket_perms_no_ioctl;
|
2016-02-18 12:52:22 +01:00
|
|
|
allow bluetooth self:capability { net_admin net_raw net_bind_service };
|
2016-05-17 06:12:17 +02:00
|
|
|
allow bluetooth self:tun_socket create_socket_perms_no_ioctl;
|
2016-02-29 05:52:55 +01:00
|
|
|
allow bluetooth tun_device:chr_file rw_file_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)
|
2013-10-29 20:45:10 +01:00
|
|
|
|
2015-09-09 19:48:04 +02:00
|
|
|
allow bluetooth audioserver_service:service_manager find;
|
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;
|
|
|
|
|
2016-04-05 19:34:53 +02:00
|
|
|
# Access to /data/media.
|
|
|
|
# This should be removed if sdcardfs is modified to alter the secontext for its
|
|
|
|
# accesses to the underlying FS.
|
2016-04-06 22:04:44 +02:00
|
|
|
allow bluetooth media_rw_data_file:dir create_dir_perms;
|
|
|
|
allow bluetooth media_rw_data_file:file create_file_perms;
|
2016-04-05 19:34:53 +02:00
|
|
|
|
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.
|
2016-02-18 12:52:22 +01: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-29 01:54:53 +01:00
|
|
|
neverallow bluetooth self:capability2 ~{ wake_alarm block_suspend };
|