blob: a00bf9f4244beb35ed214494d4a39aa6ffa28c4c [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 Klyubinab2c6812017-04-13 10:29:42 -07005add_hwservice(hal_camera_server, hw_camera_provider_ICameraProvider)
6
Eino-Ville Talvala9c43a3f2016-12-22 12:55:02 -08007# access /data/misc/camera
8allow hal_camera camera_data_file:dir create_dir_perms;
9allow hal_camera camera_data_file:file create_file_perms;
10
11allow hal_camera video_device:dir r_dir_perms;
12allow hal_camera video_device:chr_file rw_file_perms;
13allow hal_camera camera_device:chr_file rw_file_perms;
14allow hal_camera ion_device:chr_file rw_file_perms;
Alex Klyubin3a8426b2017-02-16 16:08:22 -080015# Both the client and the server need to use the graphics allocator
16allow { hal_camera_client hal_camera_server } hal_graphics_allocator:fd use;
Eino-Ville Talvala9c43a3f2016-12-22 12:55:02 -080017
Yin-Chia Yeh6824dfd2017-02-24 17:45:11 -080018# Allow hal_camera to use fd from app,gralloc,and ashmem HAL
Yin-Chia Yeh2dc4d1c2017-02-23 17:48:50 -080019allow hal_camera { appdomain -isolated_app }:fd use;
Yin-Chia Yeh2dc4d1c2017-02-23 17:48:50 -080020allow hal_camera surfaceflinger:fd use;
Alex Klyubin08d6f562017-03-17 16:51:56 -070021allow hal_camera hal_allocator_server:fd use;
Eino-Ville Talvala9c43a3f2016-12-22 12:55:02 -080022
23###
24### neverallow rules
25###
26
27# hal_camera should never execute any executable without a
28# domain transition
29neverallow hal_camera { file_type fs_type }:file execute_no_trans;
30
31# hal_camera should never need network access. Disallow network sockets.
32neverallow hal_camera domain:{ tcp_socket udp_socket rawip_socket } *;
Jeff Vander Stoep7fa59c82017-03-13 22:03:10 -070033
34# Only camera HAL may directly access the camera and video hardware
35neverallow { halserverdomain -hal_camera_server } camera_device:chr_file *;
36neverallow { halserverdomain -hal_camera_server } video_device:chr_file *;