blob: 4265b8a7c19345b681f9d5af295eb9c96fef34b7 [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
Alex Klyubin53656c12017-04-13 19:05:27 -07005add_hwservice(hal_camera_server, hal_camera_hwservice)
6allow hal_camera_client hal_camera_hwservice:hwservice_manager find;
Alex Klyubinab2c6812017-04-13 10:29:42 -07007
Eino-Ville Talvala9c43a3f2016-12-22 12:55:02 -08008allow hal_camera video_device:dir r_dir_perms;
9allow hal_camera video_device:chr_file rw_file_perms;
10allow hal_camera camera_device:chr_file rw_file_perms;
11allow hal_camera ion_device:chr_file rw_file_perms;
Alex Klyubin3a8426b2017-02-16 16:08:22 -080012# Both the client and the server need to use the graphics allocator
13allow { hal_camera_client hal_camera_server } hal_graphics_allocator:fd use;
Eino-Ville Talvala9c43a3f2016-12-22 12:55:02 -080014
Yin-Chia Yeh6824dfd2017-02-24 17:45:11 -080015# Allow hal_camera to use fd from app,gralloc,and ashmem HAL
Yin-Chia Yeh2dc4d1c2017-02-23 17:48:50 -080016allow hal_camera { appdomain -isolated_app }:fd use;
Yin-Chia Yeh2dc4d1c2017-02-23 17:48:50 -080017allow hal_camera surfaceflinger:fd use;
Alex Klyubin08d6f562017-03-17 16:51:56 -070018allow hal_camera hal_allocator_server:fd use;
Eino-Ville Talvala9c43a3f2016-12-22 12:55:02 -080019
20###
21### neverallow rules
22###
23
24# hal_camera should never execute any executable without a
25# domain transition
Jeff Vander Stoep6a28b682017-11-20 21:43:25 -080026neverallow hal_camera_server { file_type fs_type }:file execute_no_trans;
Eino-Ville Talvala9c43a3f2016-12-22 12:55:02 -080027
28# hal_camera should never need network access. Disallow network sockets.
Jeff Vander Stoep6a28b682017-11-20 21:43:25 -080029neverallow hal_camera_server domain:{ tcp_socket udp_socket rawip_socket } *;
Jeff Vander Stoep7fa59c82017-03-13 22:03:10 -070030
Jeff Vander Stoepa1c94c82017-04-25 21:06:54 -070031# Only camera HAL may directly access the camera hardware
Jeff Vander Stoep7fa59c82017-03-13 22:03:10 -070032neverallow { halserverdomain -hal_camera_server } camera_device:chr_file *;