summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2020-05-05 18:14:42 +0000
committerstsp <stsp@openbsd.org>2020-05-05 18:14:42 +0000
commit539559bc1fbfd683fee58d889b480de7b7d5c9b4 (patch)
tree019f65048ec57b69b7f7b542ac443a3f9499fd74
parentwatch the /.profile and the /.cshrc in the root directory; (diff)
downloadwireguard-openbsd-539559bc1fbfd683fee58d889b480de7b7d5c9b4.tar.xz
wireguard-openbsd-539559bc1fbfd683fee58d889b480de7b7d5c9b4.zip
Purge the ic_bss->ni_savedq mbuf queue when a wireless interface goes down.
Purging this queue prevents a panic which occurs when a WPA2-enabled athn(4) hostap interface is reconfigured while this queue contains frames. In hostap mode, this queue contains group-addressed (broadcast) frames which are buffered for clients sleeping in powersave state. Frames on this queue are transmitted when it is time to send another beacon, at which point in time sleeping clients wake up to receive such frames. The panic message is "key unset for sw crypto", which can be explained as follows: Group keys are cleared when the interface goes down. The beacon Tx interrupt handler gets triggered by hardware when the interface comes back up. This handler attempts to encrypt the queued frames for transmission, resulting in the above panic since the group key has been zeroed out. This panic has been observed with athn(4) by Jan Stary and Ted Patterson, and Ted has confirmed that this patch fixes the problem. ok kettenis@ (with the caveat that it's been a long time since he put our AP-side powersave support into a working state)
-rw-r--r--sys/net80211/ieee80211_node.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index f6349c70279..4476b440508 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_node.c,v 1.180 2020/04/08 09:34:29 stsp Exp $ */
+/* $OpenBSD: ieee80211_node.c,v 1.181 2020/05/05 18:14:42 stsp Exp $ */
/* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */
/*-
@@ -1595,6 +1595,10 @@ ieee80211_node_cleanup(struct ieee80211com *ic, struct ieee80211_node *ni)
free(ni->ni_unref_arg, M_DEVBUF, ni->ni_unref_arg_size);
ni->ni_unref_arg = NULL;
ni->ni_unref_arg_size = 0;
+
+#ifndef IEEE80211_STA_ONLY
+ mq_purge(&ni->ni_savedq);
+#endif
}
void
@@ -2047,7 +2051,7 @@ ieee80211_free_allnodes(struct ieee80211com *ic, int clear_ic_bss)
splx(s);
if (clear_ic_bss && ic->ic_bss != NULL)
- ieee80211_node_cleanup(ic, ic->ic_bss); /* for station mode */
+ ieee80211_node_cleanup(ic, ic->ic_bss);
}
void