blob: 849459455a04f5b6ffea98444452d84d88ffa961 [file] [log] [blame]
Jaihind Yadav78f021f2019-01-25 15:44:50 +05301# Copyright (c) 2019, 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
28type wcnss_service, domain;
29type wcnss_service_exec, exec_type, vendor_file_type, file_type;
30
31init_daemon_domain(wcnss_service)
32net_domain(wcnss_service)
33
34allow wcnss_service wcnss_device:chr_file rw_file_perms;
35
36qmux_socket(wcnss_service);
37
38allow wcnss_service wifi_vendor_data_file:dir create_dir_perms;
39allow wcnss_service wifi_vendor_data_file:file create_file_perms;
40
41allow wcnss_service wpa_data_file:dir create_dir_perms;
42allow wcnss_service wpa_data_file:file create_file_perms;
43
44allow wcnss_service mnt_vendor_file:dir r_dir_perms;
45qmux_socket(wcnss_service);
46
47allow wcnss_service self:{ socket qipcrtr_socket } create_socket_perms;
48# ioctlcmd=c304
49allowxperm wcnss_service self:{ socket qipcrtr_socket } ioctl msm_sock_ipc_ioctls;
50allowxperm wcnss_service self:udp_socket ioctl SIOCIWFIRSTPRIV_05;
51allow wcnss_service smem_log_device:chr_file rw_file_perms;
52allow wcnss_service proc_net:file rw_file_perms;
53
54# allow wpa_supplicant to send back wifi information to cnd
55allow wcnss_service cnd:unix_dgram_socket sendto;
56allow wcnss_service self:capability {
57 net_admin
58 net_bind_service
59};
60
61allow wcnss_service self:netlink_socket create_socket_perms_no_ioctl;
62allow wcnss_service self:netlink_generic_socket create_socket_perms_no_ioctl;
63allow wcnss_service firmware_file:dir r_dir_perms;
64allow wcnss_service firmware_file:file r_file_perms;
65allow wcnss_service sysfs_data:file r_file_perms;
66
67# allow access to network performance tuner
68unix_socket_connect(wcnss_service, wigignpt, wigignpt)
69
70userdebug_or_eng(`
71allow wcnss_service fuse:dir create_dir_perms;
72allow wcnss_service fuse:file create_file_perms;
73allow wcnss_service vfat:dir create_dir_perms;
74allow wcnss_service vfat:file create_file_perms;
75allow wcnss_service sdcardfs:dir create_dir_perms;
76allow wcnss_service sdcardfs:file create_file_perms;
77allow wcnss_service mnt_vendor_file:file rw_file_perms;
Himanshu Agrawal74e49042021-10-28 11:12:46 +053078allow wcnss_service kmsg_device:chr_file { write open };
Jaihind Yadav78f021f2019-01-25 15:44:50 +053079
80# This is needed for ptt_socket app to write logs file collected to sdcard
81r_dir_file(wcnss_service, proc_wifi_dbg)
82r_dir_file(wcnss_service, storage_file)
83r_dir_file(wcnss_service, mnt_user_file)
84diag_use(wcnss_service)
85')
86
87#binder_use(wcnss_service)
88use_vendor_per_mgr(wcnss_service)
89
90hwbinder_use(wcnss_service)
91get_prop(wcnss_service, hwservicemanager_prop)
92
93#access to perflock
94hal_client_domain(wcnss_service, hal_perf)
95
Jaihind Yadav78f021f2019-01-25 15:44:50 +053096# allow to read /sys/class/net file
97r_dir_file(wcnss_service, sysfs_net);
Himanshu Agrawalc5495482021-03-24 17:33:37 +053098
99allow wcnss_service property_socket:sock_file write;
100allow wcnss_service sysfs_soc:dir r_dir_perms;
Bharat Pawar40453d12021-12-22 18:21:09 +0530101
102allow wcnss_service wifi_vendor_wpa_socket:dir create_dir_perms;
103allow wcnss_service wifi_vendor_wpa_socket:dir r_dir_perms;
104allow wcnss_service wifi_vendor_wpa_socket:sock_file create_file_perms;
105allow wcnss_service wifi_vendor_wpa_socket:sock_file rw_file_perms;
106allow wcnss_service wifi_vendor_wpa_socket:file create_file_perms;
107allow wcnss_service wifi_vendor_wpa_socket:file rw_file_perms;
Karsten Tausche950b2a32022-08-22 16:34:58 +0200108
109set_prop(wcnss_service, vendor_wifi_config_prop)
110
111allow wcnss_service vendor_shell_exec:file execute_no_trans;
112
113allow wcnss_service kmsg_device:chr_file w_file_perms;