blob: 78d4838985bc8e9aa680a09d301376f97e560d61 [file] [log] [blame]
Alex Klyubin9b718c42017-02-17 14:51:02 -08001# HwBinder IPC from client to server, and callbacks
2binder_call(hal_drm_client, hal_drm_server)
3binder_call(hal_drm_server, hal_drm_client)
Jeff Tinkerc86f42b2017-01-01 12:01:18 -08004
5# Required by Widevine DRM (b/22990512)
6allow hal_drm self:process execmem;
7
8# Permit reading device's serial number from system properties
9get_prop(hal_drm, serialno_prop)
10
11# System file accesses
12allow hal_drm system_file:dir r_dir_perms;
13allow hal_drm system_file:file r_file_perms;
14allow hal_drm system_file:lnk_file r_file_perms;
15
16# Read files already opened under /data
17allow hal_drm system_data_file:dir { search getattr };
18allow hal_drm system_data_file:file { getattr read };
19allow hal_drm system_data_file:lnk_file r_file_perms;
20
21# Read access to pseudo filesystems
22r_dir_file(hal_drm, cgroup)
23allow hal_drm cgroup:dir { search write };
24allow hal_drm cgroup:file w_file_perms;
25
26# Allow access to ion memory allocation device
27allow hal_drm ion_device:chr_file rw_file_perms;
28allow hal_drm hal_graphics_allocator:fd use;
29
Jeff Tinker3bc24e62017-04-25 12:31:43 -070030# Allow access to fds allocated by mediaserver
31allow hal_drm mediaserver:fd use;
32
Jeff Tinkerc86f42b2017-01-01 12:01:18 -080033# Allow access to app_data and media_data_files
34allow hal_drm media_data_file:dir create_dir_perms;
35allow hal_drm media_data_file:file create_file_perms;
36allow hal_drm media_data_file:file { getattr read };
37
38allow hal_drm sysfs:file r_file_perms;
39
Jeff Tinkerc86f42b2017-01-01 12:01:18 -080040allow hal_drm tee_device:chr_file rw_file_perms;
41
42# only allow unprivileged socket ioctl commands
43allowxperm hal_drm self:{ rawip_socket tcp_socket udp_socket }
44 ioctl { unpriv_sock_ioctls unpriv_tty_ioctls };
45
46###
47### neverallow rules
48###
49
50# hal_drm should never execute any executable without a
51# domain transition
52neverallow hal_drm { file_type fs_type }:file execute_no_trans;
53
54# do not allow privileged socket ioctl commands
Alex Klyubin9b718c42017-02-17 14:51:02 -080055neverallowxperm hal_drm domain:{ rawip_socket tcp_socket udp_socket } ioctl priv_sock_ioctls;