blob: 41867ae459ce25ff48159a6b2ec0ff0a9b6c8e97 [file] [log] [blame]
Jeff Vander Stoepff1e0182017-04-13 07:51:36 -07001# bluetooth app
Alex Klyubin801b5ec2017-02-06 15:27:19 -08002
Alex Klyubinf5446eb2017-03-23 14:27:32 -07003typeattribute bluetooth coredomain;
Alex Klyubin801b5ec2017-02-06 15:27:19 -08004
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
Alex Klyubin801b5ec2017-02-06 15:27:19 -080025allow bluetooth self:capability net_admin;
26allow bluetooth self:capability2 wake_alarm;
27
28# tethering
29allow bluetooth self:packet_socket create_socket_perms_no_ioctl;
30allow bluetooth self:capability { net_admin net_raw net_bind_service };
31allow bluetooth self:tun_socket create_socket_perms_no_ioctl;
32allow bluetooth tun_device:chr_file rw_file_perms;
33allow bluetooth efs_file:dir search;
34
Jack Hea61f7f62017-04-18 18:06:41 -070035# allow Bluetooth to access uhid device for HID profile
36allow bluetooth uhid_device:chr_file rw_file_perms;
37
Alex Klyubin801b5ec2017-02-06 15:27:19 -080038# proc access.
39allow bluetooth proc_bluetooth_writable:file rw_file_perms;
40
41# Allow write access to bluetooth specific properties
42set_prop(bluetooth, bluetooth_prop)
43set_prop(bluetooth, pan_result_prop)
44
45allow bluetooth audioserver_service:service_manager find;
46allow bluetooth bluetooth_service:service_manager find;
47allow bluetooth drmserver_service:service_manager find;
48allow bluetooth mediaserver_service:service_manager find;
49allow bluetooth radio_service:service_manager find;
Alex Klyubin801b5ec2017-02-06 15:27:19 -080050allow bluetooth app_api_service:service_manager find;
51allow bluetooth system_api_service:service_manager find;
52
Alex Klyubin801b5ec2017-02-06 15:27:19 -080053# already open bugreport file descriptors may be shared with
54# the bluetooth process, from a file in
55# /data/data/com.android.shell/files/bugreports/bugreport-*.
56allow bluetooth shell_data_file:file read;
57
Philip Cuadra6eee6eb2017-03-23 10:03:49 -070058# Bluetooth audio needs RT scheduling to meet deadlines, allow sys_nice
59allow bluetooth self:capability sys_nice;
60
Alex Klyubin168435f2017-02-16 20:14:56 -080061hal_client_domain(bluetooth, hal_bluetooth)
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.
Philip Cuadra6eee6eb2017-03-23 10:03:49 -070073# Bluetooth requires net_{admin,raw,bind_service} and wake_alarm and block_suspend and sys_nice.
74neverallow bluetooth self:capability ~{ net_admin net_raw net_bind_service sys_nice};
Alex Klyubin801b5ec2017-02-06 15:27:19 -080075neverallow bluetooth self:capability2 ~{ wake_alarm block_suspend };