platform_system_sepolicy/public/hal_wifi.te

36 lines
1.5 KiB
Text
Raw Normal View History

# HwBinder IPC from client to server, and callbacks
binder_call(hal_wifi_client, hal_wifi_server)
binder_call(hal_wifi_server, hal_wifi_client)
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
2016-10-04 19:31:34 +02:00
hal_attribute_hwservice(hal_wifi, hal_wifi_hwservice)
hal_attribute_service(hal_wifi, hal_wifi_service)
binder_use(hal_wifi_server)
Restrict access to hwservicemanager This adds fine-grained policy about who can register and find which HwBinder services in hwservicemanager. Test: Play movie in Netflix and Google Play Movies Test: Play video in YouTube app and YouTube web page Test: In Google Camera app, take photo (HDR+ and conventional), record video (slow motion and normal), and check that photos look fine and videos play back with sound. Test: Cast screen to a Google Cast device Test: Get location fix in Google Maps Test: Make and receive a phone call, check that sound works both ways and that disconnecting the call frome either end works fine. Test: Run RsHelloCompute RenderScript demo app Test: Run fast subset of media CTS tests: make and install CtsMediaTestCases.apk adb shell am instrument -e size small \ -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner' Test: Play music using Google Play music Test: Adjust screen brightness via the slider in Quick Settings Test: adb bugreport Test: Enroll in fingerprint screen unlock, unlock screen using fingerprint Test: Apply OTA update: Make some visible change, e.g., rename Settings app. make otatools && \ make dist Ensure device has network connectivity ota_call.py -s <serial here> --file out/dist/sailfish-ota-*.zip Confirm the change is now live on the device Bug: 34454312 (cherry picked from commit 632bc494f199d9d85c37c1751667fe41f4b094cb) Merged-In: Iecf74000e6c68f01299667486f3c767912c076d3 Change-Id: I7a9a487beaf6f30c52ce08e04d415624da49dd31
2017-04-14 04:05:27 +02:00
Start the process of locking down proc/net Files in /proc/net leak information. This change is the first step in determining which files apps may use, whitelisting benign access, and otherwise removing access while providing safe alternative APIs. To that end, this change: * Introduces the proc_net_type attribute which will assigned to any new SELinux types in /proc/net to avoid removing access to privileged processes. These processes may be evaluated later, but are lower priority than apps. * Labels /proc/net/{tcp,tcp6,udp,udp6} as proc_net_vpn due to existing use by VPN apps. This may be replaced by an alternative API. * Audits all other proc/net access for apps. * Audits proc/net access for other processes which are currently granted broad read access to /proc/net but should not be including storaged, zygote, clatd, logd, preopt2cachename and vold. Bug: 9496886 Bug: 68016944 Test: Boot Taimen-userdebug. On both wifi and cellular: stream youtube navigate maps, send text message, make voice call, make video call. Verify no avc "granted" messages in the logs. Test: A few VPN apps including "VPN Monster", "Turbo VPN", and "Freighter". Verify no logspam with the current setup. Test: atest CtsNativeNetTestCases Test: atest netd_integration_test Test: atest QtaguidPermissionTest Test: atest FileSystemPermissionTest Change-Id: I7e49f796a25cf68bc698c6c9206e24af3ae11457 Merged-In: I7e49f796a25cf68bc698c6c9206e24af3ae11457 (cherry picked from commit 087318957f26e921d62f2e234fc14bff3c59030e)
2018-04-10 21:47:48 +02:00
r_dir_file(hal_wifi, proc_net_type)
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
2016-10-04 19:31:34 +02:00
r_dir_file(hal_wifi, sysfs_type)
set_prop(hal_wifi_server, wifi_hal_prop)
set_prop(hal_wifi, wifi_prop)
userdebug_or_eng(`get_prop(hal_wifi, persist_vendor_debug_wifi_prop)')
# allow hal wifi set interfaces up and down and get the factory MAC
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
2016-10-04 19:31:34 +02:00
allow hal_wifi self:udp_socket create_socket_perms;
allowxperm hal_wifi self:udp_socket ioctl { SIOCSIFFLAGS SIOCSIFHWADDR SIOCETHTOOL };
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
2016-10-04 19:31:34 +02:00
allow hal_wifi self:global_capability_class_set { net_admin net_raw };
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
2016-10-04 19:31:34 +02:00
# 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;
# hal_wifi writes firmware paths to this file.
allow hal_wifi sysfs_wlan_fwpath:file { w_file_perms };
# allow hal_wifi to access /proc/modules to check if Wi-Fi driver is loaded
allow hal_wifi proc_modules:file { getattr open read };
# Allow hal_wifi to send dump info to dumpstate
allow hal_wifi dumpstate:fifo_file write;
# allow hal_wifi to write into /data/vendor/tombstones/wifi
allow hal_wifi_server tombstone_wifi_data_file:dir rw_dir_perms;
allow hal_wifi_server tombstone_wifi_data_file:file create_file_perms;