hal_camera.te 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # HwBinder IPC from clients to server and callbacks
  2. binder_call(hal_camera_client, hal_camera_server)
  3. binder_call(hal_camera_server, hal_camera_client)
  4. hal_attribute_hwservice(hal_camera, hal_camera_hwservice)
  5. allow hal_camera device:dir r_dir_perms;
  6. allow hal_camera video_device:dir r_dir_perms;
  7. allow hal_camera video_device:chr_file rw_file_perms;
  8. allow hal_camera camera_device:chr_file rw_file_perms;
  9. allow hal_camera ion_device:chr_file rw_file_perms;
  10. # Both the client and the server need to use the graphics allocator
  11. allow { hal_camera_client hal_camera_server } hal_graphics_allocator:fd use;
  12. # Allow hal_camera to use fd from app,gralloc,and ashmem HAL
  13. allow hal_camera { appdomain -isolated_app }:fd use;
  14. allow hal_camera surfaceflinger:fd use;
  15. allow hal_camera hal_allocator_server:fd use;
  16. # Needed to provide debug dump output via dumpsys' pipes.
  17. allow hal_camera shell:fd use;
  18. allow hal_camera shell:fifo_file write;
  19. ###
  20. ### neverallow rules
  21. ###
  22. # hal_camera should never execute any executable without a
  23. # domain transition
  24. neverallow hal_camera_server { file_type fs_type }:file execute_no_trans;
  25. # hal_camera should never need network access. Disallow network sockets.
  26. neverallow hal_camera_server domain:{ tcp_socket udp_socket rawip_socket } *;
  27. # Only camera HAL may directly access the camera hardware
  28. neverallow { halserverdomain -hal_camera_server } camera_device:chr_file *;