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 read/write media_rw_data_file files and dirs 15allow mediaprovider_app media_rw_data_file:file create_file_perms; 16allow mediaprovider_app media_rw_data_file:dir create_dir_perms; 17 18# Talk to the DRM service 19allow mediaprovider_app drmserver_service:service_manager find; 20 21# Talk to the MediaServer service 22allow mediaprovider_app mediaserver_service:service_manager find; 23 24# Talk to the AudioServer service 25allow mediaprovider_app audioserver_service:service_manager find; 26 27# Talk to the MediaCodec APIs that log media metrics 28allow mediaprovider_app mediametrics_service:service_manager find; 29 30# Talk to regular app services 31allow mediaprovider_app app_api_service:service_manager find; 32 33# Talk to the GPU service 34binder_call(mediaprovider_app, gpuservice) 35 36# Talk to statsd 37allow mediaprovider_app statsmanager_service:service_manager find; 38binder_call(mediaprovider_app, statsd) 39 40# read pipe-max-size configuration 41allow mediaprovider_app proc_pipe_conf:file r_file_perms; 42 43# Allow MediaProvider to set extended attributes (such as quota project ID) 44# on media files. 45allowxperm mediaprovider_app media_rw_data_file:{ dir file } ioctl { 46 FS_IOC_FSGETXATTR 47 FS_IOC_FSSETXATTR 48 FS_IOC_GETFLAGS 49 FS_IOC_SETFLAGS 50}; 51 52# Access external sdcards through /mnt/media_rw 53allow mediaprovider_app { mnt_media_rw_file }:dir search; 54 55allow mediaprovider_app proc_filesystems:file r_file_perms; 56 57#Allow MediaProvider to see if sdcardfs is in use 58get_prop(mediaprovider_app, storage_config_prop) 59 60get_prop(mediaprovider_app, drm_service_config_prop) 61 62allow mediaprovider_app gpu_device:chr_file rw_file_perms; 63allow mediaprovider_app gpu_device:dir r_dir_perms; 64 65dontaudit mediaprovider_app sysfs_vendor_sched:dir search; 66dontaudit mediaprovider_app sysfs_vendor_sched:file w_file_perms; 67 68# bpfprog access for FUSE BPF 69allow mediaprovider_app fs_bpf:file read; 70allow mediaprovider_app bpfloader:bpf { map_read map_write prog_run }; 71