blob: d6c7998b922435636efd388b74b61078cf2e8239 [file] [log] [blame]
Gabriel Bireneb5872e2024-08-15 22:29:02 +00001type wifi_mainline_supplicant, domain, coredomain;
2type wifi_mainline_supplicant_exec, system_file_type, exec_type, file_type;
3
4binder_use(wifi_mainline_supplicant)
5init_daemon_domain(wifi_mainline_supplicant)
6add_service(wifi_mainline_supplicant, wifi_mainline_supplicant_service)
7
8allow wifi_mainline_supplicant self:global_capability_class_set { setuid setgid net_admin net_raw };
9allow wifi_mainline_supplicant proc_net:file rw_file_perms;
10allow wifi_mainline_supplicant sysfs_net:dir search;
11
12# Allow limited access to the parent directory /data/misc/wifi/
13allow wifi_mainline_supplicant wifi_data_file:dir { getattr search };
14
15# Create temporary socket files in /data/misc/wifi/mainline_supplicant/sockets
16allow wifi_mainline_supplicant mainline_supplicant_data_file:dir create_dir_perms;
17allow wifi_mainline_supplicant mainline_supplicant_data_file:file create_file_perms;
18allow wifi_mainline_supplicant mainline_supplicant_data_file:sock_file { create write setattr unlink };
19
20# UDP sockets
21allow wifi_mainline_supplicant self:udp_socket create_socket_perms;
22allowxperm wifi_mainline_supplicant self:udp_socket ioctl { priv_sock_ioctls SIOCSIFFLAGS SIOCSIFHWADDR };
23
24# Packet sockets
25allow wifi_mainline_supplicant self:packet_socket create_socket_perms;
26allowxperm wifi_mainline_supplicant self:packet_socket ioctl { unpriv_sock_ioctls priv_sock_ioctls unpriv_tty_ioctls };
27
28# Netlink sockets
29allow wifi_mainline_supplicant self:netlink_route_socket { bind create read write nlmsg_readpriv nlmsg_write };
Gabriel Bireneb5872e2024-08-15 22:29:02 +000030allow wifi_mainline_supplicant self:netlink_socket create_socket_perms_no_ioctl;
31allow wifi_mainline_supplicant self:netlink_generic_socket create_socket_perms_no_ioctl;