linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question on setting key right after the EAPOL 4/4 is sent.
@ 2017-06-08 23:17 Ben Greear
  2017-06-08 23:36 ` Denis Kenzior
  0 siblings, 1 reply; 16+ messages in thread
From: Ben Greear @ 2017-06-08 23:17 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org, hostap@lists.infradead.org

I believe I found a problem that may be larger than my little sandbox.

The problem I see is that sometimes (and quite often when I am using lots
of vdevs and thus the NIC is busy), the keys are set before the EAPOL 4/4
hits the air.  When the key is set, the NIC will no longer transmit the
frame because of key-length issues in the tx-descriptor (ath10k wave-2
in this case).

If I add a sleep before setting the key, then it works much more
reliably.

I suspect that there is a fundamental race between the EAPOL packet-tx
logic and the key-set logic, but supplicant appears to act as though
they are natually synchronized.

So, any suggestions on how to do this right?

Thanks,
Ben

greearb@v-f24-64 hostap]$ git diff
diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index 8a1d164..50a3006 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -1423,6 +1423,11 @@ static void wpa_supplicant_process_3_of_4(struct wpa_sm *sm,
         sm->renew_snonce = 1;

         if (key_info & WPA_KEY_INFO_INSTALL) {
+               /* Well now...what if the NIC hasn't actually put the 4/4 on the air
+                * yet?  If we set the key too soon, it is liable to corrupt the pkt being
+                * sent..   I don't know a good fix, but here is a hack.
+                */
+               os_sleep(0, 10000); /* sleep 10ms */
                 if (wpa_supplicant_install_ptk(sm, key))
                         goto failed;
         }


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-06-13  9:15 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-08 23:17 Question on setting key right after the EAPOL 4/4 is sent Ben Greear
2017-06-08 23:36 ` Denis Kenzior
2017-06-08 23:43   ` Ben Greear
2017-06-09  0:07     ` Denis Kenzior
2017-06-09  7:28       ` Johannes Berg
2017-06-09 13:10         ` Denis Kenzior
2017-06-09 19:56           ` Johannes Berg
2017-06-09 21:42             ` LINKMODE & OPERSTATE thoughts Denis Kenzior
2017-06-13  9:15               ` Johannes Berg
2017-06-09 13:46         ` Question on setting key right after the EAPOL 4/4 is sent Ben Greear
2017-06-09 20:01           ` Johannes Berg
2017-06-09 20:18             ` Ben Greear
2017-06-09 21:47               ` Janusz Dziedzic
2017-06-09 22:02                 ` Ben Greear
     [not found]                   ` <CADP2NhbXgHWo+BWhrKQndu5X7fzd2J9teqf-o6fSWwDMv8X5Hw@mail.gmail.com>
2017-06-10 16:01                     ` Ben Greear
2017-06-10 19:13               ` Arend van Spriel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).