xref: /aosp_15_r20/system/sepolicy/prebuilts/api/202404/public/mediaswcodec.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1*e4a36f41SAndroid Build Coastguard Workertype mediaswcodec, domain;
2*e4a36f41SAndroid Build Coastguard Workertype mediaswcodec_exec, system_file_type, exec_type, file_type;
3*e4a36f41SAndroid Build Coastguard Worker
4*e4a36f41SAndroid Build Coastguard Workerhal_server_domain(mediaswcodec, hal_codec2)
5*e4a36f41SAndroid Build Coastguard Worker
6*e4a36f41SAndroid Build Coastguard Worker# mediaswcodec may use an input surface from a different Codec2 service or an
7*e4a36f41SAndroid Build Coastguard Worker# OMX service
8*e4a36f41SAndroid Build Coastguard Workerhal_client_domain(mediaswcodec, hal_codec2)
9*e4a36f41SAndroid Build Coastguard Workerhal_client_domain(mediaswcodec, hal_omx)
10*e4a36f41SAndroid Build Coastguard Worker
11*e4a36f41SAndroid Build Coastguard Workerhal_client_domain(mediaswcodec, hal_allocator)
12*e4a36f41SAndroid Build Coastguard Workerhal_client_domain(mediaswcodec, hal_graphics_allocator)
13*e4a36f41SAndroid Build Coastguard Worker
14*e4a36f41SAndroid Build Coastguard Worker# get aac_drc_* properties
15*e4a36f41SAndroid Build Coastguard Workerget_prop(mediaswcodec, aac_drc_prop)
16*e4a36f41SAndroid Build Coastguard Worker
17*e4a36f41SAndroid Build Coastguard Workercrash_dump_fallback(mediaswcodec)
18*e4a36f41SAndroid Build Coastguard Worker
19*e4a36f41SAndroid Build Coastguard Worker# mediaswcodec_server should never execute any executable without a
20*e4a36f41SAndroid Build Coastguard Worker# domain transition
21*e4a36f41SAndroid Build Coastguard Workerneverallow mediaswcodec { file_type fs_type }:file execute_no_trans;
22*e4a36f41SAndroid Build Coastguard Worker
23*e4a36f41SAndroid Build Coastguard Worker# Media processing code is inherently risky and thus should have limited
24*e4a36f41SAndroid Build Coastguard Worker# permissions and be isolated from the rest of the system and network.
25*e4a36f41SAndroid Build Coastguard Worker# Lengthier explanation here:
26*e4a36f41SAndroid Build Coastguard Worker# https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
27*e4a36f41SAndroid Build Coastguard Workerneverallow mediaswcodec domain:{ udp_socket rawip_socket } *;
28*e4a36f41SAndroid Build Coastguard Workerneverallow mediaswcodec { domain userdebug_or_eng(`-su') }:tcp_socket *;
29*e4a36f41SAndroid Build Coastguard Worker
30*e4a36f41SAndroid Build Coastguard Workerallow mediaswcodec dmabuf_system_heap_device:chr_file r_file_perms;
31*e4a36f41SAndroid Build Coastguard Workerallow mediaswcodec dmabuf_system_secure_heap_device:chr_file r_file_perms;
32*e4a36f41SAndroid Build Coastguard Workerallow mediaswcodec gpu_device:chr_file rw_file_perms;
33*e4a36f41SAndroid Build Coastguard Workerallow mediaswcodec gpu_device:dir r_dir_perms;
34