]> git.ipfire.org Git - thirdparty/hostap.git/commit
nl80211: Check previous MAC address for locally-generated-deauth
authorAndrzej Ostruszka <amo@semihalf.com>
Mon, 13 Jun 2022 12:09:13 +0000 (14:09 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 27 Nov 2022 12:18:53 +0000 (14:18 +0200)
commit98e9d553f284f385f4a405e0a66330909228cd51
tree3d6315f4439fe801b9164f3b67bcedcb80dc4bc8
parent87ffa1bec6b0f665cbd54ed762d2d0ac9c9b2d8b
nl80211: Check previous MAC address for locally-generated-deauth

When using MAC randomization wpa_supplicant can change the local MAC
address during roaming scenario:

1. We attach to AP1 (with MAC1/SSID1).
2. Roaming to AP2 (with MAC2/SSID2) is started:
  a) we send DEAUTH(for AP1, with MAC1)
  b) we change MAC to MAC2 due to randomization
  c) we start authentication for AP2
  d) we get notification about DEAUTH for AP1 (which we ignore)
  e) we complete association with AP2

In point 2d we completely ignore the notification which later causes
problems. This happens if the deauthentication event is generated by the
local driver (e.g., due to beacon loss) instead of AP2 sending an
explicit Deauthentication frame.

The intended behavior is as follows: during roaming we generate DEAUTH
(2a) and signal this event right away. To protect from handling of our
own DEAUTH for the 2nd time supplicant marks 'ignore_next_local_deauth'
variable.  In point 2d we should receive this notification and clear the
flag but this does not happen because MAC1 in the notification is not
the current MAC address (it has been changed in 2b) so this notification
is ignored as a one with a "foreign" address.

So we end up successfully at AP2 but with 'ignore_next_local_deauth'
still set which causes problems.  For example if AP2 shuts down it has
been observed on some drivers that the DEAUTH notification is generated
as a local one and since we have flag to ignore it nothing is reported
over D-Bus.

To address the problem let's store the previously used MAC address and
use it for checking for foreign address (in combination with the current
one).

Signed-off-by: Andrzej Ostruszka <amo@semihalf.com>
src/drivers/driver_nl80211.c
src/drivers/driver_nl80211.h
src/drivers/driver_nl80211_event.c