From 0d323447812ce1f07e1af4e6f38d6c0a135a85da Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 26 Sep 2018 12:49:59 +0200 Subject: [PATCH] wifi: log warning when active scanning for hidden networks When there are profiles with wifi.hidden=yes, NetworkManager will actively scan for these SSIDs. This makes the scan request (and thus the user) recognizable and trackable. It seems generally a bad idea to use hidden networks, as they compromise either the privacy or usablity for the clients. Log a (rate-limited) warning about this. (cherry picked from commit 365079c09e1691073bfaf64e4c556365b0e68cf2) --- src/devices/wifi/nm-device-wifi.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c index ec1150bb3c..2ce846184e 100644 --- a/src/devices/wifi/nm-device-wifi.c +++ b/src/devices/wifi/nm-device-wifi.c @@ -96,6 +96,7 @@ typedef struct { bool requested_scan:1; bool ssid_found:1; bool is_scanning:1; + bool hidden_probe_scan_warn:1; gint64 last_scan; /* milliseconds */ gint32 scheduled_scan_time; /* seconds */ @@ -1349,8 +1350,17 @@ request_wireless_scan (NMDeviceWifi *self, _LOGD (LOGD_WIFI, "wifi-scan: scanning requested"); - if (!ssids) - ssids = hidden_ssids = build_hidden_probe_list (self); + if (!ssids) { + hidden_ssids = build_hidden_probe_list (self); + if (hidden_ssids) { + if (priv->hidden_probe_scan_warn) { + priv->hidden_probe_scan_warn = FALSE; + _LOGW (LOGD_WIFI, "wifi-scan: active scanning for networks due to profiles with wifi.hidden=yes. This makes you trackable"); + } + ssids = hidden_ssids; + } else + priv->hidden_probe_scan_warn = TRUE; + } if (_LOGD_ENABLED (LOGD_WIFI)) { if (ssids) { @@ -3244,6 +3254,7 @@ nm_device_wifi_init (NMDeviceWifi *self) c_list_init (&priv->aps_lst_head); + priv->hidden_probe_scan_warn = TRUE; priv->mode = NM_802_11_MODE_INFRA; priv->wowlan_restore = NM_SETTING_WIRELESS_WAKE_ON_WLAN_IGNORE; }