wifi_hal: Rename to 'hal_wifi'
Renaming the wifi HIDL implementation to 'hal_wifi' from 'wifi_hal_legacy'
to conform with HIDL style guide.
Denials:
01-01 21:55:23.896 2865 2865 I android.hardware.wifi@1.0-service:
wifi_hal_legacy is starting up...
01-01 21:55:23.898 2865 2865 W android.hardware.wifi@1.0-service:
/odm/lib64/hw/ does not exit.
01-01 21:55:23.899 2865 2865 F android.hardware.wifi@1.0-service:
service.cpp:59] Check failed: service->registerAsService("wifi") ==
android::NO_ERROR (service->registerAsService("wifi")=-2147483646,
android::NO_ERROR=0) Failed to register wifi HAL
01-01 21:55:23.899 2865 2865 F libc : Fatal signal 6 (SIGABRT),
code -6 in tid 2865 (android.hardwar)
01-01 21:55:23.901 377 377 W : debuggerd: handling request:
pid=2865 uid=2000 gid=2000 tid=2865
01-01 21:55:23.907 2867 2867 E : debuggerd: Unable to connect
to activity manager (connect failed: Connection refused)
01-01 21:55:23.908 2867 2867 F DEBUG : *** *** *** *** *** *** ***
*** *** *** *** *** *** *** *** ***
01-01 21:55:23.908 2867 2867 F DEBUG : Build fingerprint:
'Android/aosp_angler/angler:7.0/NYC/rpius10031052:userdebug/test-keys'
01-01 21:55:23.908 2867 2867 F DEBUG : Revision: '0'
01-01 21:55:23.908 2867 2867 F DEBUG : ABI: 'arm64'
01-01 21:55:23.908 2867 2867 F DEBUG : pid: 2865, tid: 2865, name:
android.hardwar >>> /system/bin/hw/android.hardware.wifi@1.0-service
<<<
01-01 21:55:23.909 2867 2867 F DEBUG : signal 6 (SIGABRT), code -6
(SI_TKILL), fault addr --------
01-01 21:55:23.910 2867 2867 F DEBUG : Abort message:
'service.cpp:59] Check failed: service->registerAsService("wifi") ==
android::NO_ERROR (service->registerAsService("wifi")=-2147483646,
android::NO_ERROR=0) Failed to register wifi HAL'
Bug: 31821133
Test: Compiled and ensured that the selinux denials are no longer
present in logs.
Change-Id: I5bbbcad307e9bb9e59fff87e2926751b3aecc813
diff --git a/public/hal_wifi.te b/public/hal_wifi.te
new file mode 100644
index 0000000..1f117d2
--- /dev/null
+++ b/public/hal_wifi.te
@@ -0,0 +1,22 @@
+# wifi legacy hal
+type hal_wifi, domain;
+type hal_wifi_exec, exec_type, file_type;
+
+## hwbinder access
+hwbinder_use(hal_wifi)
+
+## call into wificond process (callbacks)
+binder_call(hal_wifi, wificond)
+
+r_dir_file(hal_wifi, proc_net)
+r_dir_file(hal_wifi, sysfs_type)
+
+# allow hal wifi set interfaces up and down
+allow hal_wifi self:udp_socket create_socket_perms;
+allowxperm hal_wifi self:udp_socket ioctl { SIOCSIFFLAGS };
+
+allow hal_wifi self:capability { net_admin net_raw };
+# allow hal_wifi to speak to nl80211 in the kernel
+allow hal_wifi self:netlink_socket create_socket_perms_no_ioctl;
+# newer kernels (e.g. 4.4 but not 4.1) have a new class for sockets
+allow hal_wifi self:netlink_generic_socket create_socket_perms_no_ioctl;
diff --git a/public/wifi_hal_legacy.te b/public/wifi_hal_legacy.te
deleted file mode 100644
index ccdd96c..0000000
--- a/public/wifi_hal_legacy.te
+++ /dev/null
@@ -1,19 +0,0 @@
-# wifi legacy hal
-type wifi_hal_legacy, domain;
-type wifi_hal_legacy_exec, exec_type, file_type;
-
-## hwbinder access
-hwbinder_use(wifi_hal_legacy)
-
-## call into wificond process (callbacks)
-binder_call(wifi_hal_legacy, wificond)
-
-r_dir_file(wifi_hal_legacy, proc_net)
-r_dir_file(wifi_hal_legacy, sysfs_type)
-
-allow wifi_hal_legacy self:udp_socket create_socket_perms;
-allow wifi_hal_legacy self:capability { net_admin net_raw };
-# allow wifi_hal_legacy to speak to nl80211 in the kernel
-allow wifi_hal_legacy self:netlink_socket create_socket_perms_no_ioctl;
-# newer kernels (e.g. 4.4 but not 4.1) have a new class for sockets
-allow wifi_hal_legacy self:netlink_generic_socket create_socket_perms_no_ioctl;
diff --git a/public/wificond.te b/public/wificond.te
index 0dd709f..c6b85fc 100644
--- a/public/wificond.te
+++ b/public/wificond.te
@@ -6,7 +6,7 @@
binder_call(wificond, system_server)
hwbinder_use(wificond)
-binder_call(wificond, wifi_hal_legacy)
+binder_call(wificond, hal_wifi)
binder_call(wificond, wpa)
allow wificond wificond_service:service_manager { add find };