blob: 84f24219ac8e4fb4e66252e4e2134603e75f479d [file] [log] [blame]
Steven Moreland7baf7252018-05-25 16:23:37 -07001type mediacodec, domain, mlstrustedsubject;
2type mediacodec_exec, exec_type, vendor_file_type, file_type;
3
4init_daemon_domain(mediacodec)
5
Chong Zhangbdbfff12018-09-20 12:07:44 -07006# can route /dev/binder traffic to /dev/vndbinder
7vndbinder_use(mediacodec)
8
Pawin Vongmasa609c2432019-04-30 05:09:28 -07009hal_server_domain(mediacodec, hal_codec2)
Steven Moreland7baf7252018-05-25 16:23:37 -070010hal_server_domain(mediacodec, hal_omx)
11
Pawin Vongmasa609c2432019-04-30 05:09:28 -070012# mediacodec may use an input surface from a different Codec2 or OMX service
13hal_client_domain(mediacodec, hal_codec2)
14hal_client_domain(mediacodec, hal_omx)
15
Steven Moreland7baf7252018-05-25 16:23:37 -070016hal_client_domain(mediacodec, hal_allocator)
Steven Moreland7baf7252018-05-25 16:23:37 -070017hal_client_domain(mediacodec, hal_graphics_allocator)
Chong Zhangbdbfff12018-09-20 12:07:44 -070018
19allow mediacodec gpu_device:chr_file rw_file_perms;
Jason Macnak4ddaa3f2022-02-24 18:32:16 +000020allow mediacodec gpu_device:dir r_dir_perms;
Pawin Vongmasa609c2432019-04-30 05:09:28 -070021allow mediacodec ion_device:chr_file rw_file_perms;
Hridya Valsaraju0fee0132021-01-13 21:05:07 -080022allow mediacodec dmabuf_system_heap_device:chr_file r_file_perms;
Chong Zhangbdbfff12018-09-20 12:07:44 -070023allow mediacodec video_device:chr_file rw_file_perms;
24allow mediacodec video_device:dir search;
25
Pawin Vongmasa609c2432019-04-30 05:09:28 -070026crash_dump_fallback(mediacodec)
27
Inseob Kimbdcbcf02020-05-06 18:30:20 +090028# get aac_drc_* properties
29get_prop(mediacodec, aac_drc_prop)
30
Pawin Vongmasa609c2432019-04-30 05:09:28 -070031# mediacodec should never execute any executable without a domain transition
32neverallow mediacodec { file_type fs_type }:file execute_no_trans;
33
34# Media processing code is inherently risky and thus should have limited
35# permissions and be isolated from the rest of the system and network.
36# Lengthier explanation here:
37# https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
Yifan Hongbe04b092021-06-07 12:37:31 -070038neverallow mediacodec domain:{ udp_socket rawip_socket } *;
39neverallow mediacodec { domain userdebug_or_eng(`-su') }:tcp_socket *;
Pawin Vongmasa609c2432019-04-30 05:09:28 -070040