xref: /aosp_15_r20/system/sepolicy/private/wificond.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1*e4a36f41SAndroid Build Coastguard Workertypeattribute wificond coredomain;
2*e4a36f41SAndroid Build Coastguard Worker
3*e4a36f41SAndroid Build Coastguard Workerset_prop(wificond, wifi_hal_prop)
4*e4a36f41SAndroid Build Coastguard Workerset_prop(wificond, wifi_prop)
5*e4a36f41SAndroid Build Coastguard Workerset_prop(wificond, ctl_default_prop)
6*e4a36f41SAndroid Build Coastguard Worker
7*e4a36f41SAndroid Build Coastguard Workerget_prop(wificond, hwservicemanager_prop)
8*e4a36f41SAndroid Build Coastguard Worker
9*e4a36f41SAndroid Build Coastguard Workerallow wificond legacykeystore_service:service_manager find;
10*e4a36f41SAndroid Build Coastguard Worker
11*e4a36f41SAndroid Build Coastguard Workerinit_daemon_domain(wificond)
12*e4a36f41SAndroid Build Coastguard Worker
13*e4a36f41SAndroid Build Coastguard Workerbinder_use(wificond)
14*e4a36f41SAndroid Build Coastguard Workerbinder_call(wificond, system_server)
15*e4a36f41SAndroid Build Coastguard Workerbinder_call(wificond, keystore)
16*e4a36f41SAndroid Build Coastguard Worker
17*e4a36f41SAndroid Build Coastguard Workeradd_service(wificond, wifinl80211_service)
18*e4a36f41SAndroid Build Coastguard Workerhal_client_domain(wificond, hal_nlinterceptor)
19*e4a36f41SAndroid Build Coastguard Worker
20*e4a36f41SAndroid Build Coastguard Worker# create sockets to set interfaces up and down
21*e4a36f41SAndroid Build Coastguard Workerallow wificond self:udp_socket create_socket_perms;
22*e4a36f41SAndroid Build Coastguard Worker# setting interface state up/down is a privileged ioctl
23*e4a36f41SAndroid Build Coastguard Workerallowxperm wificond self:udp_socket ioctl { SIOCSIFFLAGS SIOCSIFHWADDR };
24*e4a36f41SAndroid Build Coastguard Workerallow wificond self:global_capability_class_set { net_admin net_raw };
25*e4a36f41SAndroid Build Coastguard Worker# allow wificond to speak to nl80211 in the kernel
26*e4a36f41SAndroid Build Coastguard Workerallow wificond self:netlink_socket create_socket_perms_no_ioctl;
27*e4a36f41SAndroid Build Coastguard Worker# newer kernels (e.g. 4.4 but not 4.1) have a new class for sockets
28*e4a36f41SAndroid Build Coastguard Workerallow wificond self:netlink_generic_socket create_socket_perms_no_ioctl;
29*e4a36f41SAndroid Build Coastguard Worker
30*e4a36f41SAndroid Build Coastguard Workerr_dir_file(wificond, proc_net_type)
31*e4a36f41SAndroid Build Coastguard Worker
32*e4a36f41SAndroid Build Coastguard Worker# allow wificond to check permission for dumping logs
33*e4a36f41SAndroid Build Coastguard Workerallow wificond permission_service:service_manager find;
34*e4a36f41SAndroid Build Coastguard Worker
35*e4a36f41SAndroid Build Coastguard Worker# dumpstate support
36*e4a36f41SAndroid Build Coastguard Workerallow wificond dumpstate:fd use;
37*e4a36f41SAndroid Build Coastguard Workerallow wificond dumpstate:fifo_file write;
38*e4a36f41SAndroid Build Coastguard Worker
39*e4a36f41SAndroid Build Coastguard Worker#### Offer the Wifi Keystore HwBinder service ###
40*e4a36f41SAndroid Build Coastguard Workerhwbinder_use(wificond)
41*e4a36f41SAndroid Build Coastguard Workertypeattribute wificond wifi_keystore_service_server;
42*e4a36f41SAndroid Build Coastguard Workeradd_hwservice(wificond, system_wifi_keystore_hwservice)
43*e4a36f41SAndroid Build Coastguard Worker
44*e4a36f41SAndroid Build Coastguard Worker# Allow keystore2 binder access to serve the HwBinder service.
45*e4a36f41SAndroid Build Coastguard Workerallow wificond keystore_service:service_manager find;
46*e4a36f41SAndroid Build Coastguard Workerallow wificond wifi_key:keystore2_key {
47*e4a36f41SAndroid Build Coastguard Worker    get_info
48*e4a36f41SAndroid Build Coastguard Worker    use
49*e4a36f41SAndroid Build Coastguard Worker};
50