2016-05-19 19:31:20 -07:00
|
|
|
# wificond
|
|
|
|
type wificond, domain;
|
|
|
|
type wificond_exec, exec_type, file_type;
|
|
|
|
|
|
|
|
init_daemon_domain(wificond)
|
2016-06-03 10:08:56 -07:00
|
|
|
|
|
|
|
binder_use(wificond)
|
|
|
|
binder_call(wificond, system_server)
|
2016-06-30 08:20:29 -07:00
|
|
|
binder_call(wificond, wpa)
|
2016-06-03 10:08:56 -07:00
|
|
|
|
|
|
|
allow wificond wificond_service:service_manager { add find };
|
2016-06-30 14:23:12 -07:00
|
|
|
|
2016-08-22 17:47:36 -07:00
|
|
|
# wificond writes firmware paths to this file.
|
|
|
|
# wificond also changes the owership of this file on startup.
|
|
|
|
allow wificond sysfs_wlan_fwpath:file { w_file_perms setattr };
|
2016-06-29 11:28:20 -07:00
|
|
|
|
|
|
|
set_prop(wificond, wifi_prop)
|
2016-07-22 14:34:26 -07:00
|
|
|
set_prop(wificond, ctl_default_prop)
|
2016-06-30 17:48:12 -07:00
|
|
|
|
|
|
|
# create sockets to set interfaces up and down
|
|
|
|
allow wificond self:udp_socket create_socket_perms;
|
2016-08-31 17:46:42 -07:00
|
|
|
# See discussion in b/31226503
|
|
|
|
allowxperm wificond self:udp_socket ioctl unpriv_sock_ioctls;
|
2016-08-22 17:47:13 -07:00
|
|
|
# setting interface state up/down is a privileged ioctl
|
|
|
|
allowxperm wificond self:udp_socket ioctl { SIOCSIFFLAGS };
|
2016-07-18 16:48:50 -07:00
|
|
|
allow wificond self:capability { net_admin net_raw };
|
2016-08-22 17:47:13 -07:00
|
|
|
# allow wificond to speak to nl80211 in the kernel
|
2016-07-18 16:48:50 -07:00
|
|
|
allow wificond self:netlink_socket create_socket_perms;
|
2016-08-31 17:46:42 -07:00
|
|
|
# newer kernels (e.g. 4.4 but not 4.1) have a new class for sockets
|
|
|
|
allow wificond self:netlink_generic_socket create_socket_perms;
|
2016-06-30 17:48:12 -07:00
|
|
|
|
|
|
|
r_dir_file(wificond, proc_net)
|
2016-07-21 09:12:28 -07:00
|
|
|
|
|
|
|
# wificond writes out configuration files for wpa_supplicant/hostapd.
|
2016-07-29 10:26:54 -07:00
|
|
|
# wificond also reads pid files out of this directory
|
2016-07-21 09:12:28 -07:00
|
|
|
allow wificond wifi_data_file:dir rw_dir_perms;
|
|
|
|
allow wificond wifi_data_file:file create_file_perms;
|
2016-08-22 17:47:36 -07:00
|
|
|
|
|
|
|
# wificond drops root shortly after starting
|
|
|
|
# wificond changes the ownership of some files before dropping root
|
|
|
|
allow wificond self:capability { setuid setgid setpcap chown };
|
2016-07-29 10:26:54 -07:00
|
|
|
|
2016-08-15 12:58:58 -07:00
|
|
|
# wificond cleans up sockets created by wpa_supplicant and framework
|
|
|
|
allow wificond wpa_socket:dir rw_dir_perms;
|
|
|
|
allow wificond system_wpa_socket:sock_file unlink;
|
|
|
|
allow wificond wpa_socket:sock_file unlink;
|