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