blob: ef624f5b1fca1e36ca8b037243b262985eb5ae71 [file] [log] [blame]
Michael Bestas0feb07d2018-10-05 00:37:23 +03001# Copyright (c) 2015,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
28# Allow hostapd_cli to work. hostapd_cli creates a socket in
29# /data/misc/wifi/sockets which hostapd communicates with.
Sridhar Parasuram64fdeae2018-02-02 16:09:10 -080030#
31
32# userspace wifi access points
33type hostapd, domain;
34type hostapd_exec, exec_type, vendor_file_type, file_type;
35
Michael Bestas0feb07d2018-10-05 00:37:23 +030036userdebug_or_eng(`
37 unix_socket_send(hostapd, wifi_vendor_wpa, su)
38')
39
40binder_call(hostapd, cnd)
41unix_socket_connect(hostapd, cnd, cnd)
42unix_socket_send(hostapd, cnd, cnd)
43allow hostapd cnd:{
44 fifo_file
45 netlink_route_socket
46 netlink_tcpdiag_socket
47 unix_stream_socket} { read write };
48allow hostapd cnd:fifo_file r_file_perms;
49allow hostapd smem_log_device:chr_file rw_file_perms;
50allow hostapd fstman:unix_dgram_socket sendto;
51allow hostapd wifi_vendor_data_file:dir w_dir_perms;
52allow hostapd wifi_vendor_data_file:file create_file_perms;
Sridhar Parasuram64fdeae2018-02-02 16:09:10 -080053allow hostapd hostapd_data_file:dir w_dir_perms;
54allow hostapd hostapd_data_file:sock_file create_file_perms;
Michael Bestas0feb07d2018-10-05 00:37:23 +030055# wigig_hostapd has its own directory for sockets,
56# in order to prevent conflicts with wifi hostapd
57# allow wigig_hostapd to create the directory holding its control socket
58allow hostapd wigig_hostapd_socket:dir create_dir_perms;
59# wigig_hostapd needs to create, bind to, read and write its control socket
60allow hostapd wigig_hostapd_socket:sock_file create_file_perms;
61# allow wigig_hostapd to send replies to wigighalsvc
62allow hostapd wigighalsvc:unix_dgram_socket sendto;
63# allow hostapd to attach to fstman socket
64allow hostapd wpa_socket:dir r_dir_perms;
65allow hostapd wpa_socket:sock_file rw_file_perms;
66allow hostapd wifi_vendor_wpa_socket:dir r_dir_perms;
67allow hostapd wifi_vendor_wpa_socket:sock_file rw_file_perms;