blob: e0f5d7f192d7c3e8bca5f43af0c22051fa49fb48 [file] [log] [blame]
Ernie Hsu3b4a36a2024-07-17 10:04:25 +00001type mediacodec_google, domain;
2type mediacodec_google_exec, exec_type, vendor_file_type, file_type;
3
4init_daemon_domain(mediacodec_google)
5
Ernie Hsubbe999c2024-07-18 10:41:41 +00006hal_server_domain(mediacodec_google, hal_codec2)
7
8hal_client_domain(mediacodec_google, hal_graphics_allocator)
9
10allow mediacodec_google dmabuf_system_heap_device:chr_file r_file_perms;
Ernie Hsua01bc1d2024-08-27 03:32:27 +000011allow mediacodec_google video_device:chr_file { read write open ioctl map };
Ernie Hsubbe999c2024-07-18 10:41:41 +000012
13# mediacodec_google should never execute any executable without a domain transition
14neverallow mediacodec_google { file_type fs_type }:file execute_no_trans;
15
16# Media processing code is inherently risky and thus should have limited
17# permissions and be isolated from the rest of the system and network.
18# Lengthier explanation here:
19# https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
20neverallow mediacodec_google domain:{ udp_socket rawip_socket } *;
21neverallow mediacodec_google { domain userdebug_or_eng(`-su') }:tcp_socket *;