2012-01-04 18:33:27 +01:00
|
|
|
# wpa - wpa supplicant or equivalent
|
2015-11-03 18:54:39 +01:00
|
|
|
type wpa, domain, domain_deprecated;
|
2012-01-04 18:33:27 +01:00
|
|
|
type wpa_exec, exec_type, file_type;
|
|
|
|
|
2014-02-24 21:06:11 +01:00
|
|
|
net_domain(wpa)
|
2016-05-17 06:12:17 +02:00
|
|
|
# in addition to ioctls whitelisted for all domains, grant wpa priv_sock_ioctls.
|
|
|
|
allowxperm wpa self:udp_socket ioctl priv_sock_ioctls;
|
2014-02-24 21:06:11 +01:00
|
|
|
|
2016-09-10 01:27:17 +02:00
|
|
|
r_dir_file(wpa, sysfs_type)
|
|
|
|
r_dir_file(wpa, proc_net)
|
|
|
|
|
2013-10-29 19:42:41 +01:00
|
|
|
allow wpa kernel:system module_request;
|
|
|
|
allow wpa self:capability { setuid net_admin setgid net_raw };
|
|
|
|
allow wpa cgroup:dir create_dir_perms;
|
2014-02-24 21:06:11 +01:00
|
|
|
allow wpa self:netlink_route_socket nlmsg_write;
|
2016-05-17 06:12:17 +02:00
|
|
|
allow wpa self:netlink_socket create_socket_perms_no_ioctl;
|
|
|
|
allow wpa self:netlink_generic_socket create_socket_perms_no_ioctl;
|
2014-02-24 21:06:11 +01:00
|
|
|
allow wpa self:packet_socket create_socket_perms;
|
2016-05-17 06:12:17 +02:00
|
|
|
allowxperm wpa self:packet_socket ioctl { unpriv_sock_ioctls priv_sock_ioctls unpriv_tty_ioctls };
|
2013-10-29 19:42:41 +01:00
|
|
|
allow wpa wifi_data_file:dir create_dir_perms;
|
|
|
|
allow wpa wifi_data_file:file create_file_perms;
|
|
|
|
unix_socket_send(wpa, system_wpa, system_server)
|
|
|
|
|
2016-09-29 00:12:23 +02:00
|
|
|
# HIDL interface exposed by WPA.
|
|
|
|
hwbinder_use(wpa)
|
2016-06-30 17:20:29 +02:00
|
|
|
binder_call(wpa, wificond)
|
2014-03-12 21:30:47 +01:00
|
|
|
|
2013-10-29 19:42:41 +01:00
|
|
|
# Create a socket for receiving info from wpa
|
2014-02-21 17:28:20 +01:00
|
|
|
allow wpa wpa_socket:dir create_dir_perms;
|
2013-10-29 19:42:41 +01:00
|
|
|
allow wpa wpa_socket:sock_file create_file_perms;
|
2014-01-25 00:46:27 +01:00
|
|
|
|
2014-06-17 23:58:52 +02:00
|
|
|
use_keystore(wpa)
|
|
|
|
|
|
|
|
# WPA (wifi) has a restricted set of permissions from the default.
|
|
|
|
allow wpa keystore:keystore_key {
|
|
|
|
get
|
|
|
|
sign
|
|
|
|
verify
|
|
|
|
};
|
|
|
|
|
2014-01-25 00:46:27 +01:00
|
|
|
# Allow wpa_cli to work. wpa_cli creates a socket in
|
|
|
|
# /data/misc/wifi/sockets which wpa supplicant communicates with.
|
|
|
|
userdebug_or_eng(`
|
|
|
|
unix_socket_send(wpa, wpa, su)
|
|
|
|
')
|
2014-10-31 21:45:30 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
### neverallow rules
|
|
|
|
###
|
|
|
|
|
|
|
|
# wpa_supplicant should not trust any data from sdcards
|
|
|
|
neverallow wpa sdcard_type:dir ~getattr;
|
|
|
|
neverallow wpa sdcard_type:file *;
|