cameraserver.te 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # cameraserver - camera daemon
  2. type cameraserver, domain;
  3. type cameraserver_exec, system_file_type, exec_type, file_type;
  4. type cameraserver_tmpfs, file_type;
  5. binder_use(cameraserver)
  6. binder_call(cameraserver, binderservicedomain)
  7. binder_call(cameraserver, appdomain)
  8. binder_service(cameraserver)
  9. hal_client_domain(cameraserver, hal_camera)
  10. hal_client_domain(cameraserver, hal_graphics_allocator)
  11. allow cameraserver ion_device:chr_file rw_file_perms;
  12. # Talk with graphics composer fences
  13. allow cameraserver hal_graphics_composer:fd use;
  14. add_service(cameraserver, cameraserver_service)
  15. add_hwservice(cameraserver, fwk_camera_hwservice)
  16. allow cameraserver activity_service:service_manager find;
  17. allow cameraserver appops_service:service_manager find;
  18. allow cameraserver audioserver_service:service_manager find;
  19. allow cameraserver batterystats_service:service_manager find;
  20. allow cameraserver cameraproxy_service:service_manager find;
  21. allow cameraserver mediaserver_service:service_manager find;
  22. allow cameraserver processinfo_service:service_manager find;
  23. allow cameraserver scheduling_policy_service:service_manager find;
  24. allow cameraserver sensor_privacy_service:service_manager find;
  25. allow cameraserver surfaceflinger_service:service_manager find;
  26. allow cameraserver hidl_token_hwservice:hwservice_manager find;
  27. ###
  28. ### neverallow rules
  29. ###
  30. # cameraserver should never execute any executable without a
  31. # domain transition
  32. neverallow cameraserver { file_type fs_type }:file execute_no_trans;
  33. # The goal of the mediaserver split is to place media processing code into
  34. # restrictive sandboxes with limited responsibilities and thus limited
  35. # permissions. Example: Audioserver is only responsible for controlling audio
  36. # hardware and processing audio content. Cameraserver does the same for camera
  37. # hardware/content. Etc.
  38. #
  39. # Media processing code is inherently risky and thus should have limited
  40. # permissions and be isolated from the rest of the system and network.
  41. # Lengthier explanation here:
  42. # https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
  43. neverallow cameraserver domain:{ tcp_socket udp_socket rawip_socket } *;
  44. # Allow shell commands from ADB for CTS testing/dumping
  45. allow cameraserver adbd:fd use;
  46. allow cameraserver adbd:unix_stream_socket { read write };
  47. allow cameraserver shell:fd use;
  48. allow cameraserver shell:unix_stream_socket { read write };
  49. allow cameraserver shell:fifo_file { read write };
  50. # Allow to talk with media codec
  51. allow cameraserver mediametrics_service:service_manager find;
  52. hal_client_domain(cameraserver, hal_codec2)
  53. hal_client_domain(cameraserver, hal_omx)
  54. hal_client_domain(cameraserver, hal_allocator)
  55. # Allow shell commands from ADB for CTS testing/dumping
  56. userdebug_or_eng(`
  57. allow cameraserver su:fd use;
  58. allow cameraserver su:fifo_file { read write };
  59. allow cameraserver su:unix_stream_socket { read write };
  60. ')