xref: /aosp_15_r20/system/sepolicy/private/hal_wifi.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1*e4a36f41SAndroid Build Coastguard Worker# HwBinder IPC from client to server, and callbacks
2*e4a36f41SAndroid Build Coastguard Workerbinder_call(hal_wifi_client, hal_wifi_server)
3*e4a36f41SAndroid Build Coastguard Workerbinder_call(hal_wifi_server, hal_wifi_client)
4*e4a36f41SAndroid Build Coastguard Worker
5*e4a36f41SAndroid Build Coastguard Workerhal_attribute_hwservice(hal_wifi, hal_wifi_hwservice)
6*e4a36f41SAndroid Build Coastguard Workerhal_attribute_service(hal_wifi, hal_wifi_service)
7*e4a36f41SAndroid Build Coastguard Worker
8*e4a36f41SAndroid Build Coastguard Workerbinder_use(hal_wifi_server)
9*e4a36f41SAndroid Build Coastguard Worker
10*e4a36f41SAndroid Build Coastguard Workerr_dir_file(hal_wifi, proc_net_type)
11*e4a36f41SAndroid Build Coastguard Workerr_dir_file(hal_wifi, sysfs_type)
12*e4a36f41SAndroid Build Coastguard Worker
13*e4a36f41SAndroid Build Coastguard Workerset_prop(hal_wifi_server, wifi_hal_prop)
14*e4a36f41SAndroid Build Coastguard Workerset_prop(hal_wifi, wifi_prop)
15*e4a36f41SAndroid Build Coastguard Workeruserdebug_or_eng(`get_prop(hal_wifi, persist_vendor_debug_wifi_prop)')
16*e4a36f41SAndroid Build Coastguard Worker
17*e4a36f41SAndroid Build Coastguard Worker# allow hal wifi set interfaces up and down and get the factory MAC
18*e4a36f41SAndroid Build Coastguard Workerallow hal_wifi self:udp_socket create_socket_perms;
19*e4a36f41SAndroid Build Coastguard Workerallowxperm hal_wifi self:udp_socket ioctl { SIOCSIFFLAGS SIOCSIFHWADDR SIOCETHTOOL };
20*e4a36f41SAndroid Build Coastguard Worker
21*e4a36f41SAndroid Build Coastguard Workerallow hal_wifi self:global_capability_class_set { net_admin net_raw };
22*e4a36f41SAndroid Build Coastguard Worker# allow hal_wifi to speak to nl80211 in the kernel
23*e4a36f41SAndroid Build Coastguard Workerallow hal_wifi self:netlink_socket create_socket_perms_no_ioctl;
24*e4a36f41SAndroid Build Coastguard Worker# newer kernels (e.g. 4.4 but not 4.1) have a new class for sockets
25*e4a36f41SAndroid Build Coastguard Workerallow hal_wifi self:netlink_generic_socket create_socket_perms_no_ioctl;
26*e4a36f41SAndroid Build Coastguard Worker# hal_wifi writes firmware paths to this file.
27*e4a36f41SAndroid Build Coastguard Workerallow hal_wifi sysfs_wlan_fwpath:file { w_file_perms };
28*e4a36f41SAndroid Build Coastguard Worker# allow hal_wifi to access /proc/modules to check if Wi-Fi driver is loaded
29*e4a36f41SAndroid Build Coastguard Workerallow hal_wifi proc_modules:file { getattr open read };
30*e4a36f41SAndroid Build Coastguard Worker# Allow hal_wifi to send dump info to dumpstate
31*e4a36f41SAndroid Build Coastguard Workerallow hal_wifi dumpstate:fifo_file write;
32*e4a36f41SAndroid Build Coastguard Worker
33*e4a36f41SAndroid Build Coastguard Worker# allow hal_wifi to write into /data/vendor/tombstones/wifi
34*e4a36f41SAndroid Build Coastguard Workerallow hal_wifi_server tombstone_wifi_data_file:dir rw_dir_perms;
35*e4a36f41SAndroid Build Coastguard Workerallow hal_wifi_server tombstone_wifi_data_file:file create_file_perms;
36