blob: 0616e54cc2b0717ea421420e7643612a08f99141 [file] [log] [blame]
Deepak Kushwahfb797d92017-06-30 18:53:23 +05301# Copyright (c) 2017, The Linux Foundation. All rights reserved.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions are
5# met:
6# * Redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer.
8# * Redistributions in binary form must reproduce the above
9# copyright notice, this list of conditions and the following
10# disclaimer in the documentation and/or other materials provided
11# with the distribution.
12# * Neither the name of The Linux Foundation nor the names of its
13# contributors may be used to endorse or promote products derived
14# from this software without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28typeattribute wfdservice coredomain;
Pawan Chilka300b38c2017-07-12 18:49:55 +053029
30#Allow for transition from init domain to wfdservice
31init_daemon_domain(wfdservice)
32
33#Inherit base socket permissions from netd domain
34net_domain(wfdservice)
35
36#Allow wfdservice to use Binder IPC
37binder_use(wfdservice)
38
39#Allow for interaction with Display HAL
40binder_call(wfdservice, surfaceflinger)
41binder_call(surfaceflinger, wfdservice)
42
43#Allow apps to interact with wfdservice
44binder_call(wfdservice, platform_app)
45binder_call(platform_app, wfdservice)
46binder_call(wfdservice, system_app)
47binder_call(system_app, wfdservice)
48
49#Allow access to Audio Flinger APIs
50binder_call(wfdservice, audioserver)
51
52#Allow access to Permission Controller in System Server
53binder_call(wfdservice, system_server)
54
55# Mark wfdservice as a Binder service domain
56binder_service(wfdservice)
57
58#Allow wfdservice to be registered with service manager
59allow wfdservice wfdservice_service:service_manager add;
60
61#Allow access to PCM sound card
62allow wfdservice audio_device:chr_file rw_file_perms;
63allow wfdservice audio_device:dir r_dir_perms;
64
65#Allow access to /dev/graphics/fb* for screen capture
66allow wfdservice graphics_device:chr_file rw_file_perms;
67
68#Allow access to encoder for YUV statistics
69allow wfdservice gpu_device:chr_file rw_file_perms;
70
Pawan Chilka300b38c2017-07-12 18:49:55 +053071#Allow access to /dev/video/* devices for encoding/decoding
72allow wfdservice video_device:chr_file rw_file_perms;
73allow wfdservice video_device:dir r_dir_perms;
74
75#Allow access to tee device for HDCP sessions
76allow wfdservice tee_device:chr_file rw_file_perms;
77
78#Allow access to uhid driver for HID event injection
79allow wfdservice uhid_device:chr_file rw_file_perms;
80
81#Allow PROT_EXEC for 3rd party library loaded by wfdservice
82allow wfdservice self:process execmem;
83
84userdebug_or_eng(`
85#Allow access to read mmosal_logmask file in /data partition
86 allow wfdservice system_data_file:file r_file_perms;
87#Allow access to dump encoder/decoder dumps in /data/misc/media
88 allow wfdservice media_data_file:dir w_dir_perms;
89 allow wfdservice media_data_file:file create_file_perms;
90')
91
92#Allow access to /data/media for dumping
93allow wfdservice media_rw_data_file:dir create_dir_perms;
94allow wfdservice media_rw_data_file:file create_file_perms;
95
96allow wfdservice self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
97
98# Allow access to input_device for touch input detection
99allow wfdservice input_device:dir r_dir_perms;
100allow wfdservice input_device:chr_file r_file_perms;
101
102# Allow access to mediaserver, surfaceflinger and permissionmanager
103# for interaction of wfdservice
104allow wfdservice {audioserver_service permission_service surfaceflinger_service wfdservice_service}: service_manager find;
105
106#Allow setting of net_admin capability so that libnl API's can be used
107allow wfdservice self:capability net_admin;
108
109#allow binder call to mediacodec from wfdservice
110binder_call(wfdservice, mediacodec);
111
112#Allow wfdservice to query interface name of network (p2p etc.)
113allow wfdservice self:netlink_socket create_socket_perms_no_ioctl;
Amit Kumar036eab72017-12-05 15:52:50 +0530114allow wfdservice self:netlink_generic_socket create_socket_perms_no_ioctl;
Pawan Chilka300b38c2017-07-12 18:49:55 +0530115
116#Allow ion device access
117allow wfdservice ion_device:chr_file r_file_perms;
118
119#Allow udp socket ioctl
120allow wfdservice self:udp_socket ioctl;
121
122# ioctlcmd=8bff
123allowxperm wfdservice self:udp_socket ioctl priv_sock_ioctls;
124
125#Allow access to proc/net/arp
126allow wfdservice proc_net:file r_file_perms;