blob: df70ab67439fb21cf672041631a83f7525388b35 [file] [log] [blame]
Alex Klyubin3a8426b2017-02-16 16:08:22 -08001# HwBinder IPC from clients to server and callbacks
2binder_call(hal_camera_client, hal_camera_server)
3binder_call(hal_camera_server, hal_camera_client)
Eino-Ville Talvala9c43a3f2016-12-22 12:55:02 -08004
Jayant Chowdharye3019be2022-01-20 00:47:54 -08005#binder IPC from client to service manager and callbacks
6binder_use(hal_camera_server)
7
Steven Moreland9234e002018-06-06 09:30:18 -07008hal_attribute_hwservice(hal_camera, hal_camera_hwservice)
Jayant Chowdharye3019be2022-01-20 00:47:54 -08009hal_attribute_service(hal_camera, hal_camera_service)
Alex Klyubinab2c6812017-04-13 10:29:42 -070010
Yin-Chia Yeh746c61f2018-01-23 16:02:34 -080011allow hal_camera device:dir r_dir_perms;
Eino-Ville Talvala9c43a3f2016-12-22 12:55:02 -080012allow hal_camera video_device:dir r_dir_perms;
13allow hal_camera video_device:chr_file rw_file_perms;
14allow hal_camera camera_device:chr_file rw_file_perms;
15allow hal_camera ion_device:chr_file rw_file_perms;
Hridya Valsaraju8d5403c2021-02-15 21:57:42 -080016allow hal_camera dmabuf_system_heap_device:chr_file r_file_perms;
17
Alex Klyubin3a8426b2017-02-16 16:08:22 -080018# Both the client and the server need to use the graphics allocator
19allow { hal_camera_client hal_camera_server } hal_graphics_allocator:fd use;
Eino-Ville Talvala9c43a3f2016-12-22 12:55:02 -080020
Yin-Chia Yeh6824dfd2017-02-24 17:45:11 -080021# Allow hal_camera to use fd from app,gralloc,and ashmem HAL
Yin-Chia Yeh2dc4d1c2017-02-23 17:48:50 -080022allow hal_camera { appdomain -isolated_app }:fd use;
Yin-Chia Yeh2dc4d1c2017-02-23 17:48:50 -080023allow hal_camera surfaceflinger:fd use;
Alex Klyubin08d6f562017-03-17 16:51:56 -070024allow hal_camera hal_allocator_server:fd use;
Eino-Ville Talvala9c43a3f2016-12-22 12:55:02 -080025
Yin-Chia Yeh77c7d6f2018-02-26 14:08:21 -080026# Needed to provide debug dump output via dumpsys' pipes.
27allow hal_camera shell:fd use;
28allow hal_camera shell:fifo_file write;
29
Eino-Ville Talvala9c43a3f2016-12-22 12:55:02 -080030###
31### neverallow rules
32###
33
34# hal_camera should never execute any executable without a
35# domain transition
Jeff Vander Stoep6a28b682017-11-20 21:43:25 -080036neverallow hal_camera_server { file_type fs_type }:file execute_no_trans;
Eino-Ville Talvala9c43a3f2016-12-22 12:55:02 -080037
38# hal_camera should never need network access. Disallow network sockets.
Jayant Chowdharye3019be2022-01-20 00:47:54 -080039neverallow hal_camera_server { domain userdebug_or_eng(`-su') }:{ tcp_socket udp_socket rawip_socket } *;
Jeff Vander Stoep7fa59c82017-03-13 22:03:10 -070040
Jeff Vander Stoepa1c94c82017-04-25 21:06:54 -070041# Only camera HAL may directly access the camera hardware
Jeff Vander Stoep7fa59c82017-03-13 22:03:10 -070042neverallow { halserverdomain -hal_camera_server } camera_device:chr_file *;