2015-12-04 01:10:05 +01:00
|
|
|
# cameraserver - camera daemon
|
2016-02-05 23:17:22 +01:00
|
|
|
type cameraserver, domain;
|
2018-09-27 19:21:37 +02:00
|
|
|
type cameraserver_exec, system_file_type, exec_type, file_type;
|
2019-01-29 02:13:57 +01:00
|
|
|
type cameraserver_tmpfs, file_type;
|
2015-12-04 01:10:05 +01:00
|
|
|
|
|
|
|
binder_use(cameraserver)
|
|
|
|
binder_call(cameraserver, binderservicedomain)
|
|
|
|
binder_call(cameraserver, appdomain)
|
|
|
|
binder_service(cameraserver)
|
|
|
|
|
2017-02-17 01:08:22 +01:00
|
|
|
hal_client_domain(cameraserver, hal_camera)
|
2017-04-13 19:29:42 +02:00
|
|
|
|
2017-03-20 22:30:01 +01:00
|
|
|
hal_client_domain(cameraserver, hal_graphics_allocator)
|
2016-12-22 21:55:02 +01:00
|
|
|
|
2016-02-05 23:17:22 +01:00
|
|
|
allow cameraserver ion_device:chr_file rw_file_perms;
|
2021-02-16 06:57:42 +01:00
|
|
|
allow cameraserver dmabuf_system_heap_device:chr_file r_file_perms;
|
2015-12-04 01:10:05 +01:00
|
|
|
|
2017-04-15 00:55:20 +02:00
|
|
|
# Talk with graphics composer fences
|
|
|
|
allow cameraserver hal_graphics_composer:fd use;
|
|
|
|
|
2017-01-19 22:23:52 +01:00
|
|
|
add_service(cameraserver, cameraserver_service)
|
2018-08-17 01:21:13 +02:00
|
|
|
add_hwservice(cameraserver, fwk_camera_hwservice)
|
2018-01-16 01:11:42 +01:00
|
|
|
|
|
|
|
allow cameraserver activity_service:service_manager find;
|
2015-12-04 01:10:05 +01:00
|
|
|
allow cameraserver appops_service:service_manager find;
|
|
|
|
allow cameraserver audioserver_service:service_manager find;
|
|
|
|
allow cameraserver batterystats_service:service_manager find;
|
2016-02-05 23:17:22 +01:00
|
|
|
allow cameraserver cameraproxy_service:service_manager find;
|
2015-12-04 01:10:05 +01:00
|
|
|
allow cameraserver mediaserver_service:service_manager find;
|
2021-02-20 02:21:12 +01:00
|
|
|
allow cameraserver package_native_service:service_manager find;
|
2015-12-04 01:10:05 +01:00
|
|
|
allow cameraserver processinfo_service:service_manager find;
|
2016-02-12 03:03:31 +01:00
|
|
|
allow cameraserver scheduling_policy_service:service_manager find;
|
2018-12-19 02:30:17 +01:00
|
|
|
allow cameraserver sensor_privacy_service:service_manager find;
|
2015-12-04 01:10:05 +01:00
|
|
|
allow cameraserver surfaceflinger_service:service_manager find;
|
|
|
|
|
2017-04-14 04:05:27 +02:00
|
|
|
allow cameraserver hidl_token_hwservice:hwservice_manager find;
|
|
|
|
|
2015-12-04 01:10:05 +01:00
|
|
|
###
|
|
|
|
### neverallow rules
|
|
|
|
###
|
|
|
|
|
|
|
|
# cameraserver should never execute any executable without a
|
|
|
|
# domain transition
|
|
|
|
neverallow cameraserver { file_type fs_type }:file execute_no_trans;
|
2016-04-23 00:34:40 +02:00
|
|
|
|
2017-02-16 21:34:51 +01:00
|
|
|
# The goal of the mediaserver split is to place media processing code into
|
|
|
|
# restrictive sandboxes with limited responsibilities and thus limited
|
|
|
|
# permissions. Example: Audioserver is only responsible for controlling audio
|
|
|
|
# hardware and processing audio content. Cameraserver does the same for camera
|
|
|
|
# hardware/content. Etc.
|
|
|
|
#
|
|
|
|
# Media processing code is inherently risky and thus should have limited
|
|
|
|
# permissions and be isolated from the rest of the system and network.
|
|
|
|
# Lengthier explanation here:
|
|
|
|
# https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
|
2016-04-23 00:34:40 +02:00
|
|
|
neverallow cameraserver domain:{ tcp_socket udp_socket rawip_socket } *;
|
2018-01-16 01:11:42 +01:00
|
|
|
|
|
|
|
# Allow shell commands from ADB for CTS testing/dumping
|
|
|
|
allow cameraserver adbd:fd use;
|
|
|
|
allow cameraserver adbd:unix_stream_socket { read write };
|
2018-01-23 02:07:17 +01:00
|
|
|
allow cameraserver shell:fd use;
|
|
|
|
allow cameraserver shell:unix_stream_socket { read write };
|
2018-03-01 01:12:40 +01:00
|
|
|
allow cameraserver shell:fifo_file { read write };
|
2018-01-16 01:11:42 +01:00
|
|
|
|
2019-01-16 20:51:35 +01:00
|
|
|
# Allow to talk with media codec
|
|
|
|
allow cameraserver mediametrics_service:service_manager find;
|
2019-04-30 14:09:28 +02:00
|
|
|
hal_client_domain(cameraserver, hal_codec2)
|
2019-01-16 20:51:35 +01:00
|
|
|
hal_client_domain(cameraserver, hal_omx)
|
|
|
|
hal_client_domain(cameraserver, hal_allocator)
|
|
|
|
|
2018-01-16 01:11:42 +01:00
|
|
|
# Allow shell commands from ADB for CTS testing/dumping
|
|
|
|
userdebug_or_eng(`
|
|
|
|
allow cameraserver su:fd use;
|
|
|
|
allow cameraserver su:fifo_file { read write };
|
|
|
|
allow cameraserver su:unix_stream_socket { read write };
|
|
|
|
')
|