bluetoothd.te 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. type bluetoothd, domain;
  2. type bluetoothd_exec, exec_type, file_type;
  3. type bluetoothd_main_exec, exec_type, file_type;
  4. # Start bluetoothd from init
  5. init_daemon_domain(bluetoothd)
  6. # Data file accesses
  7. allow bluetoothd bluetooth_data_file:dir w_dir_perms;
  8. allow bluetoothd bluetooth_data_file:notdevfile_class_set create_file_perms;
  9. allow bluetoothd self:capability { setuid net_admin net_bind_service net_raw };
  10. allow bluetoothd kernel:system module_request;
  11. # TODO: this may be romoved for userbuild where we don't use bluetoothd_wrapper
  12. allow bluetoothd bluetoothd_main_exec:file { execute execute_no_trans read open };
  13. # IPC socket communication
  14. allow bluetoothd self:socket { create_socket_perms accept listen setopt getopt };
  15. # Allow clients to use a socket provided by the bluetooth app.
  16. allow bluetoothd { bluetooth mediaserver }:unix_stream_socket connectto;
  17. # Allow system app to use sockets and fds
  18. allow bluetooth bluetoothd:fd use;
  19. allow bluetooth bluetoothd:unix_stream_socket rw_socket_perms;
  20. # Allow user bluetooth apps to use sockets and fds
  21. allow bluetoothdomain bluetoothd:fd use;
  22. allow bluetoothdomain bluetoothd:unix_stream_socket { getopt setopt getattr read write ioctl shutdown };
  23. # Other domains that can create and use bluetooth sockets.
  24. allow bluetoothdomain self:socket create_socket_perms;
  25. #This we might should put to mediaserver.te ?
  26. allow mediaserver bluetoothd:fd use;
  27. allow mediaserver bluetoothd:socket rw_socket_perms;
  28. # needs /system/bin/log access
  29. allow bluetoothd devpts:chr_file rw_file_perms;
  30. # access to uhid device
  31. allow bluetoothd uhid_device:chr_file rw_file_perms;
  32. # tethering
  33. allow bluetoothd self:udp_socket create_socket_perms;
  34. allow bluetoothd self:tcp_socket { create ioctl };