xref: /aosp_15_r20/system/sepolicy/prebuilts/api/34.0/private/mediaprovider_app.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1###
2### A domain for further sandboxing the MediaProvider mainline module.
3###
4type mediaprovider_app, domain, coredomain, bpfdomain;
5
6app_domain(mediaprovider_app)
7
8# Access to /mnt/pass_through.
9r_dir_file(mediaprovider_app, mnt_pass_through_file)
10
11# Allow MediaProvider to host a FUSE daemon for external storage
12allow mediaprovider_app fuse_device:chr_file { read write ioctl getattr };
13
14# Allow MediaProvider to access fuseblk devices for external storage.
15allow mediaprovider_app fuseblk:dir create_dir_perms;
16allow mediaprovider_app fuseblk:file create_file_perms;
17
18# Allow MediaProvider to read/write media_rw_data_file files and dirs
19allow mediaprovider_app media_userdir_file:dir r_dir_perms;
20allow mediaprovider_app media_rw_data_file:file create_file_perms;
21allow mediaprovider_app media_rw_data_file:dir create_dir_perms;
22
23# Talk to the DRM service
24allow mediaprovider_app drmserver_service:service_manager find;
25
26# Talk to the MediaServer service
27allow mediaprovider_app mediaserver_service:service_manager find;
28
29# Talk to the AudioServer service
30allow mediaprovider_app audioserver_service:service_manager find;
31
32# Talk to the MediaCodec APIs that log media metrics
33allow mediaprovider_app mediametrics_service:service_manager find;
34
35# Talk to regular app services
36allow mediaprovider_app app_api_service:service_manager find;
37
38# Talk to the GPU service
39binder_call(mediaprovider_app, gpuservice)
40
41# Talk to statsd
42allow mediaprovider_app statsmanager_service:service_manager find;
43binder_call(mediaprovider_app, statsd)
44
45# read pipe-max-size configuration
46allow mediaprovider_app proc_pipe_conf:file r_file_perms;
47
48# Allow MediaProvider to set extended attributes (such as quota project ID)
49# on media files.
50allowxperm mediaprovider_app media_rw_data_file:{ dir file } ioctl {
51  FS_IOC_FSGETXATTR
52  FS_IOC_FSSETXATTR
53  FS_IOC_GETFLAGS
54  FS_IOC_SETFLAGS
55};
56
57# Access external sdcards through /mnt/media_rw
58allow mediaprovider_app { mnt_media_rw_file }:dir search;
59
60allow mediaprovider_app proc_filesystems:file r_file_perms;
61
62#Allow MediaProvider to see if sdcardfs is in use
63get_prop(mediaprovider_app, storage_config_prop)
64
65get_prop(mediaprovider_app, drm_service_config_prop)
66
67allow mediaprovider_app gpu_device:chr_file rw_file_perms;
68allow mediaprovider_app gpu_device:dir r_dir_perms;
69
70dontaudit mediaprovider_app sysfs_vendor_sched:dir search;
71dontaudit mediaprovider_app sysfs_vendor_sched:file w_file_perms;
72
73# bpfprog access for FUSE BPF
74allow mediaprovider_app fs_bpf:file read;
75allow mediaprovider_app bpfloader:bpf { map_read map_write prog_run };
76