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