hal_omx.te 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # applies all permissions to hal_omx NOT hal_omx_server
  2. # since OMX must always be in its own process.
  3. binder_call(hal_omx_server, binderservicedomain)
  4. binder_call(hal_omx_server, { appdomain -isolated_app })
  5. # Allow hal_omx_server access to composer sync fences
  6. allow hal_omx_server hal_graphics_composer:fd use;
  7. allow hal_omx_server ion_device:chr_file rw_file_perms;
  8. allow hal_omx_server hal_camera:fd use;
  9. crash_dump_fallback(hal_omx_server)
  10. # Recieve gralloc buffer FDs from bufferhubd. Note that hal_omx_server never
  11. # directly connects to bufferhubd via PDX. Instead, a VR app acts as a bridge
  12. # between those two: it talks to hal_omx_server via Binder and talks to bufferhubd
  13. # via PDX. Thus, there is no need to use pdx_client macro.
  14. allow hal_omx_server bufferhubd:fd use;
  15. hal_attribute_hwservice(hal_omx, hal_omx_hwservice)
  16. allow hal_omx_client hidl_token_hwservice:hwservice_manager find;
  17. binder_call(hal_omx_client, hal_omx_server)
  18. binder_call(hal_omx_server, hal_omx_client)
  19. ###
  20. ### neverallow rules
  21. ###
  22. # hal_omx_server should never execute any executable without a
  23. # domain transition
  24. neverallow hal_omx_server { file_type fs_type }:file execute_no_trans;
  25. # The goal of the mediaserver split is to place media processing code into
  26. # restrictive sandboxes with limited responsibilities and thus limited
  27. # permissions. Example: Audioserver is only responsible for controlling audio
  28. # hardware and processing audio content. Cameraserver does the same for camera
  29. # hardware/content. Etc.
  30. #
  31. # Media processing code is inherently risky and thus should have limited
  32. # permissions and be isolated from the rest of the system and network.
  33. # Lengthier explanation here:
  34. # https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
  35. neverallow hal_omx_server domain:{ tcp_socket udp_socket rawip_socket } *;