2018-05-26 01:23:37 +02:00
|
|
|
# applies all permissions to hal_omx NOT hal_omx_server
|
|
|
|
# since OMX must always be in its own process.
|
|
|
|
|
|
|
|
binder_call(hal_omx_server, binderservicedomain)
|
|
|
|
binder_call(hal_omx_server, { appdomain -isolated_app })
|
|
|
|
|
|
|
|
# Allow hal_omx_server access to composer sync fences
|
|
|
|
allow hal_omx_server hal_graphics_composer:fd use;
|
|
|
|
|
|
|
|
allow hal_omx_server ion_device:chr_file rw_file_perms;
|
|
|
|
allow hal_omx_server hal_camera:fd use;
|
|
|
|
|
|
|
|
crash_dump_fallback(hal_omx_server)
|
|
|
|
|
|
|
|
# Recieve gralloc buffer FDs from bufferhubd. Note that hal_omx_server never
|
|
|
|
# directly connects to bufferhubd via PDX. Instead, a VR app acts as a bridge
|
|
|
|
# between those two: it talks to hal_omx_server via Binder and talks to bufferhubd
|
|
|
|
# via PDX. Thus, there is no need to use pdx_client macro.
|
|
|
|
allow hal_omx_server bufferhubd:fd use;
|
|
|
|
|
2018-06-06 18:30:18 +02:00
|
|
|
hal_attribute_hwservice(hal_omx, hal_omx_hwservice)
|
2018-09-20 21:07:44 +02:00
|
|
|
|
2018-05-26 01:23:37 +02:00
|
|
|
allow hal_omx_client hidl_token_hwservice:hwservice_manager find;
|
|
|
|
|
2020-03-07 13:15:38 +01:00
|
|
|
get_prop(hal_omx_client, media_variant_prop)
|
|
|
|
get_prop(hal_omx_server, media_variant_prop)
|
|
|
|
|
2018-05-26 01:23:37 +02:00
|
|
|
binder_call(hal_omx_client, hal_omx_server)
|
2018-05-31 01:43:17 +02:00
|
|
|
binder_call(hal_omx_server, hal_omx_client)
|
2018-05-26 01:23:37 +02:00
|
|
|
|
|
|
|
###
|
|
|
|
### neverallow rules
|
|
|
|
###
|
|
|
|
|
|
|
|
# hal_omx_server should never execute any executable without a
|
|
|
|
# domain transition
|
|
|
|
neverallow hal_omx_server { file_type fs_type }:file execute_no_trans;
|
|
|
|
|
|
|
|
# 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
|
2021-06-07 21:37:31 +02:00
|
|
|
neverallow hal_omx_server domain:{ udp_socket rawip_socket } *;
|
|
|
|
neverallow hal_omx_server { domain userdebug_or_eng(`-su') }:tcp_socket *;
|