xref: /aosp_15_r20/system/sepolicy/private/hal_drm.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1*e4a36f41SAndroid Build Coastguard Worker# HwBinder IPC from client to server, and callbacks
2*e4a36f41SAndroid Build Coastguard Workerbinder_use(hal_drm_server)
3*e4a36f41SAndroid Build Coastguard Workerbinder_call(hal_drm_client, hal_drm_server)
4*e4a36f41SAndroid Build Coastguard Workerbinder_call(hal_drm_server, hal_drm_client)
5*e4a36f41SAndroid Build Coastguard Worker
6*e4a36f41SAndroid Build Coastguard Workerhal_attribute_hwservice(hal_drm, hal_drm_hwservice)
7*e4a36f41SAndroid Build Coastguard Workerhal_attribute_service(hal_drm, hal_drm_service)
8*e4a36f41SAndroid Build Coastguard Worker
9*e4a36f41SAndroid Build Coastguard Workerallow hal_drm hidl_memory_hwservice:hwservice_manager find;
10*e4a36f41SAndroid Build Coastguard Worker
11*e4a36f41SAndroid Build Coastguard Worker# Required by Widevine DRM (b/22990512)
12*e4a36f41SAndroid Build Coastguard Workerallow hal_drm self:process execmem;
13*e4a36f41SAndroid Build Coastguard Worker
14*e4a36f41SAndroid Build Coastguard Worker# Permit reading device's serial number from system properties
15*e4a36f41SAndroid Build Coastguard Workerget_prop(hal_drm_server, serialno_prop)
16*e4a36f41SAndroid Build Coastguard Worker# Permit reading force L3 system property
17*e4a36f41SAndroid Build Coastguard Workerget_prop(hal_drm_server, drm_forcel3_prop)
18*e4a36f41SAndroid Build Coastguard Worker
19*e4a36f41SAndroid Build Coastguard Worker# Read files already opened under /data
20*e4a36f41SAndroid Build Coastguard Workerallow hal_drm system_data_file:file { getattr read };
21*e4a36f41SAndroid Build Coastguard Worker
22*e4a36f41SAndroid Build Coastguard Worker# Read access to pseudo filesystems
23*e4a36f41SAndroid Build Coastguard Workerr_dir_file(hal_drm, cgroup)
24*e4a36f41SAndroid Build Coastguard Workerallow hal_drm cgroup:dir { search write };
25*e4a36f41SAndroid Build Coastguard Workerallow hal_drm cgroup:file w_file_perms;
26*e4a36f41SAndroid Build Coastguard Worker
27*e4a36f41SAndroid Build Coastguard Workerr_dir_file(hal_drm, cgroup_v2)
28*e4a36f41SAndroid Build Coastguard Workerallow hal_drm cgroup_v2:dir { search write };
29*e4a36f41SAndroid Build Coastguard Workerallow hal_drm cgroup_v2:file w_file_perms;
30*e4a36f41SAndroid Build Coastguard Worker
31*e4a36f41SAndroid Build Coastguard Worker# Allow dumpsys Widevine without root
32*e4a36f41SAndroid Build Coastguard Workerallow hal_drm_server shell:fd use;
33*e4a36f41SAndroid Build Coastguard Workerallow hal_drm_server shell:fifo_file write;
34*e4a36f41SAndroid Build Coastguard Worker
35*e4a36f41SAndroid Build Coastguard Worker# Allow access to ion memory allocation device
36*e4a36f41SAndroid Build Coastguard Workerallow hal_drm ion_device:chr_file rw_file_perms;
37*e4a36f41SAndroid Build Coastguard Workerallow hal_drm hal_graphics_allocator:fd use;
38*e4a36f41SAndroid Build Coastguard Worker
39*e4a36f41SAndroid Build Coastguard Worker# Allow access to hidl_memory allocation service
40*e4a36f41SAndroid Build Coastguard Workerallow hal_drm hal_allocator_server:fd use;
41*e4a36f41SAndroid Build Coastguard Worker
42*e4a36f41SAndroid Build Coastguard Worker# Allow access to fds allocated by mediaserver
43*e4a36f41SAndroid Build Coastguard Workerallow hal_drm mediaserver:fd use;
44*e4a36f41SAndroid Build Coastguard Worker
45*e4a36f41SAndroid Build Coastguard Workerallow hal_drm sysfs:file r_file_perms;
46*e4a36f41SAndroid Build Coastguard Worker
47*e4a36f41SAndroid Build Coastguard Workerallow hal_drm tee_device:chr_file rw_file_perms;
48*e4a36f41SAndroid Build Coastguard Worker
49*e4a36f41SAndroid Build Coastguard Workerallow hal_drm_server { appdomain -isolated_app }:fd use;
50*e4a36f41SAndroid Build Coastguard Worker
51*e4a36f41SAndroid Build Coastguard Worker# only allow unprivileged socket ioctl commands
52*e4a36f41SAndroid Build Coastguard Workerallowxperm hal_drm self:{ rawip_socket tcp_socket udp_socket }
53*e4a36f41SAndroid Build Coastguard Worker  ioctl { unpriv_sock_ioctls unpriv_tty_ioctls };
54*e4a36f41SAndroid Build Coastguard Worker
55*e4a36f41SAndroid Build Coastguard Worker###
56*e4a36f41SAndroid Build Coastguard Worker### neverallow rules
57*e4a36f41SAndroid Build Coastguard Worker###
58*e4a36f41SAndroid Build Coastguard Worker
59*e4a36f41SAndroid Build Coastguard Worker# hal_drm should never execute any executable without a
60*e4a36f41SAndroid Build Coastguard Worker# domain transition
61*e4a36f41SAndroid Build Coastguard Workerneverallow hal_drm_server { file_type fs_type }:file execute_no_trans;
62*e4a36f41SAndroid Build Coastguard Worker
63*e4a36f41SAndroid Build Coastguard Worker# do not allow privileged socket ioctl commands
64*e4a36f41SAndroid Build Coastguard Workerneverallowxperm hal_drm_server domain:{ rawip_socket tcp_socket udp_socket } ioctl priv_sock_ioctls;
65