1# mediadrmserver - mediadrm daemon
2type mediadrmserver, domain;
3type mediadrmserver_exec, exec_type, file_type;
4
5typeattribute mediadrmserver mlstrustedsubject;
6
7net_domain(mediadrmserver)
8init_daemon_domain(mediadrmserver)
9
10binder_use(mediadrmserver)
11binder_call(mediadrmserver, binderservicedomain)
12binder_call(mediadrmserver, appdomain)
13binder_service(mediadrmserver)
14
15# Required by Widevine DRM (b/22990512)
16allow mediadrmserver self:process execmem;
17
18# System file accesses.
19allow mediadrmserver system_file:dir r_dir_perms;
20allow mediadrmserver system_file:file r_file_perms;
21allow mediadrmserver system_file:lnk_file r_file_perms;
22
23# Read files already opened under /data.
24allow mediadrmserver system_data_file:dir { search getattr };
25allow mediadrmserver system_data_file:file { getattr read };
26allow mediadrmserver system_data_file:lnk_file r_file_perms;
27
28# Read access to pseudo filesystems.
29r_dir_file(mediadrmserver, cgroup)
30allow mediadrmserver cgroup:dir { search write };
31allow mediadrmserver cgroup:file w_file_perms;
32
33# Allow access to ion memory allocation device
34allow mediadrmserver ion_device:chr_file rw_file_perms;
35
36# Allow access to app_data and media_data_files
37allow mediadrmserver media_data_file:dir create_dir_perms;
38allow mediadrmserver media_data_file:file create_file_perms;
39allow mediadrmserver media_data_file:file { getattr read };
40
41allow mediadrmserver tee_device:chr_file rw_file_perms;
42
43# XXX Label with a specific type?
44allow mediadrmserver sysfs:file r_file_perms;
45
46# Connect to tee service.
47allow mediadrmserver tee:unix_stream_socket connectto;
48
49allow mediadrmserver mediadrmserver_service:service_manager { add find };
50allow mediadrmserver mediaserver_service:service_manager { add find };
51allow mediadrmserver processinfo_service:service_manager find;
52
53# only allow unprivileged socket ioctl commands
54allowxperm mediadrmserver self:{ rawip_socket tcp_socket udp_socket }
55  ioctl { unpriv_sock_ioctls unpriv_tty_ioctls };
56
57###
58### neverallow rules
59###
60
61# mediadrmserver should never execute any executable without a
62# domain transition
63neverallow mediadrmserver { file_type fs_type }:file execute_no_trans;
64
65# do not allow privileged socket ioctl commands
66neverallowxperm mediadrmserver domain:{ rawip_socket tcp_socket udp_socket } ioctl priv_sock_ioctls;
67