blob: 5ea6027f2be87f22aec93856147c918220969ce7 [file] [log] [blame]
Alex Klyubin801b5ec2017-02-06 15:27:19 -08001# bluetooth subsystem
2
3typeattribute bluetooth domain_deprecated;
4
5app_domain(bluetooth)
6net_domain(bluetooth)
7
dcashmancc39f632016-07-22 13:13:11 -07008# Socket creation under /data/misc/bluedroid.
9type_transition bluetooth bluetooth_data_file:sock_file bluetooth_socket;
dcashman2e00e632016-10-12 14:58:09 -070010
Alex Klyubin801b5ec2017-02-06 15:27:19 -080011# Allow access to net_admin ioctls
12allowxperm bluetooth self:udp_socket ioctl priv_sock_ioctls;
13
14wakelock_use(bluetooth);
15
16# Data file accesses.
17allow bluetooth bluetooth_data_file:dir create_dir_perms;
18allow bluetooth bluetooth_data_file:notdevfile_class_set create_file_perms;
19allow bluetooth bluetooth_logs_data_file:dir rw_dir_perms;
20allow bluetooth bluetooth_logs_data_file:file create_file_perms;
21
22# Socket creation under /data/misc/bluedroid.
23allow bluetooth bluetooth_socket:sock_file create_file_perms;
24
25# bluetooth factory file accesses.
26r_dir_file(bluetooth, bluetooth_efs_file)
27
28allow bluetooth { uhid_device hci_attach_dev }:chr_file rw_file_perms;
29
30# sysfs access.
31r_dir_file(bluetooth, sysfs_type)
32allow bluetooth sysfs_bluetooth_writable:file rw_file_perms;
33allow bluetooth self:capability net_admin;
34allow bluetooth self:capability2 wake_alarm;
35
36# tethering
37allow bluetooth self:packet_socket create_socket_perms_no_ioctl;
38allow bluetooth self:capability { net_admin net_raw net_bind_service };
39allow bluetooth self:tun_socket create_socket_perms_no_ioctl;
40allow bluetooth tun_device:chr_file rw_file_perms;
41allow bluetooth efs_file:dir search;
42
43# proc access.
44allow bluetooth proc_bluetooth_writable:file rw_file_perms;
45
46# Allow write access to bluetooth specific properties
47set_prop(bluetooth, bluetooth_prop)
48set_prop(bluetooth, pan_result_prop)
49
50allow bluetooth audioserver_service:service_manager find;
51allow bluetooth bluetooth_service:service_manager find;
52allow bluetooth drmserver_service:service_manager find;
53allow bluetooth mediaserver_service:service_manager find;
54allow bluetooth radio_service:service_manager find;
55allow bluetooth surfaceflinger_service:service_manager find;
56allow bluetooth app_api_service:service_manager find;
57allow bluetooth system_api_service:service_manager find;
58
59# Bluetooth Sim Access Profile Socket to the RIL
60unix_socket_connect(bluetooth, sap_uim, rild)
61
62# already open bugreport file descriptors may be shared with
63# the bluetooth process, from a file in
64# /data/data/com.android.shell/files/bugreports/bugreport-*.
65allow bluetooth shell_data_file:file read;
66
67# Perform HwBinder IPC.
68hwbinder_use(bluetooth)
69binder_call(bluetooth, hal_bluetooth)
70binder_call(bluetooth, hal_telephony)
71
72read_runtime_log_tags(bluetooth)
73
74###
75### Neverallow rules
76###
77### These are things that the bluetooth app should NEVER be able to do
78###
79
80# Superuser capabilities.
81# bluetooth requires net_{admin,raw,bind_service} and wake_alarm and block_suspend.
82neverallow bluetooth self:capability ~{ net_admin net_raw net_bind_service };
83neverallow bluetooth self:capability2 ~{ wake_alarm block_suspend };