2015-09-22 19:56:03 +02:00
|
|
|
# mediaextractor - multimedia daemon
|
2016-09-13 06:15:15 +02:00
|
|
|
type mediaextractor, domain;
|
2018-09-27 19:21:37 +02:00
|
|
|
type mediaextractor_exec, system_file_type, exec_type, file_type;
|
2019-01-24 00:07:40 +01:00
|
|
|
type mediaextractor_tmpfs, file_type;
|
2015-09-22 19:56:03 +02:00
|
|
|
|
|
|
|
typeattribute mediaextractor mlstrustedsubject;
|
|
|
|
|
|
|
|
binder_use(mediaextractor)
|
|
|
|
binder_call(mediaextractor, binderservicedomain)
|
|
|
|
binder_call(mediaextractor, appdomain)
|
|
|
|
binder_service(mediaextractor)
|
|
|
|
|
2017-01-19 22:23:52 +01:00
|
|
|
add_service(mediaextractor, mediaextractor_service)
|
2017-01-24 21:53:45 +01:00
|
|
|
allow mediaextractor mediametrics_service:service_manager find;
|
2017-09-26 21:58:29 +02:00
|
|
|
allow mediaextractor hidl_token_hwservice:hwservice_manager find;
|
2015-09-22 19:56:03 +02:00
|
|
|
|
2016-09-10 01:27:17 +02:00
|
|
|
allow mediaextractor system_server:fd use;
|
|
|
|
|
2017-09-26 21:58:29 +02:00
|
|
|
hal_client_domain(mediaextractor, hal_cas)
|
2018-12-17 23:04:00 +01:00
|
|
|
hal_client_domain(mediaextractor, hal_allocator)
|
2017-09-26 21:58:29 +02:00
|
|
|
|
2016-09-10 01:27:17 +02:00
|
|
|
r_dir_file(mediaextractor, cgroup)
|
2021-02-12 00:18:11 +01:00
|
|
|
r_dir_file(mediaextractor, cgroup_v2)
|
2016-09-10 01:27:17 +02:00
|
|
|
allow mediaextractor proc_meminfo:file r_file_perms;
|
|
|
|
|
2017-03-07 03:13:05 +01:00
|
|
|
crash_dump_fallback(mediaextractor)
|
|
|
|
|
2016-07-13 23:04:37 +02:00
|
|
|
# allow mediaextractor read permissions for file sources
|
sepolicy: Grant mediaextractor access to files over all types of sdcard fs
* Account for all possible sdcard-related filesystem types and not only
sdcardfs:
public/file.te:108:type fuse, sdcard_type, fs_type, mlstrustedobject;
public/file.te:109:type sdcardfs, sdcard_type, fs_type, mlstrustedobject;
public/file.te:111:type vfat, sdcard_type, fs_type, mlstrustedobject;
public/file.te:112:type exfat, sdcard_type, fs_type, mlstrustedobject;
Change-Id: Ic508397bf4ca66a002ada33ac3f600c17b8a1a10
2018-11-16 12:12:37 +01:00
|
|
|
allow mediaextractor sdcard_type:file { getattr read };
|
2016-07-13 23:04:37 +02:00
|
|
|
allow mediaextractor media_rw_data_file:file { getattr read };
|
2018-08-03 00:54:23 +02:00
|
|
|
allow mediaextractor { app_data_file privapp_data_file }:file { getattr read };
|
2016-07-13 23:04:37 +02:00
|
|
|
|
2017-04-19 19:05:38 +02:00
|
|
|
# Read resources from open apk files passed over Binder
|
|
|
|
allow mediaextractor apk_data_file:file { read getattr };
|
|
|
|
allow mediaextractor asec_apk_file:file { read getattr };
|
|
|
|
allow mediaextractor ringtone_file:file { read getattr };
|
|
|
|
|
2020-04-23 16:38:43 +02:00
|
|
|
# overlay package access
|
|
|
|
allow mediaextractor vendor_overlay_file:file { read map };
|
|
|
|
|
2017-10-02 22:00:52 +02:00
|
|
|
# scan extractor library directory to dynamically load extractors
|
|
|
|
allow mediaextractor system_file:dir { read open };
|
|
|
|
|
2015-09-22 19:56:03 +02:00
|
|
|
###
|
|
|
|
### neverallow rules
|
|
|
|
###
|
|
|
|
|
|
|
|
# mediaextractor should never execute any executable without a
|
|
|
|
# domain transition
|
|
|
|
neverallow mediaextractor { file_type fs_type }:file execute_no_trans;
|
2016-01-05 17:54:11 +01:00
|
|
|
|
2017-02-16 21:34:51 +01:00
|
|
|
# The goal of the mediaserver split is to place media processing code into
|
|
|
|
# restrictive sandboxes with limited responsibilities and thus limited
|
|
|
|
# permissions. Example: Audioserver is only responsible for controlling audio
|
|
|
|
# hardware and processing audio content. Cameraserver does the same for camera
|
|
|
|
# hardware/content. Etc.
|
|
|
|
#
|
|
|
|
# Media processing code is inherently risky and thus should have limited
|
|
|
|
# permissions and be isolated from the rest of the system and network.
|
|
|
|
# Lengthier explanation here:
|
|
|
|
# https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
|
2021-06-07 21:37:31 +02:00
|
|
|
neverallow mediaextractor domain:{ udp_socket rawip_socket } *;
|
|
|
|
neverallow mediaextractor { domain userdebug_or_eng(`-su') }:tcp_socket *;
|
2017-10-06 22:05:32 +02:00
|
|
|
|
|
|
|
# mediaextractor should not be opening /data files directly. Any files
|
|
|
|
# it touches (with a few exceptions) need to be passed to it via a file
|
|
|
|
# descriptor opened outside the process.
|
|
|
|
neverallow mediaextractor {
|
|
|
|
data_file_type
|
|
|
|
-zoneinfo_data_file # time zone data from /data/misc/zoneinfo
|
2017-11-06 20:19:07 +01:00
|
|
|
userdebug_or_eng(`-apk_data_file') # for loading media extractor plugins
|
2019-06-14 00:05:15 +02:00
|
|
|
with_native_coverage(`-method_trace_data_file')
|
2017-10-06 22:05:32 +02:00
|
|
|
}:file open;
|