summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2017-07-22 16:54:46 +0000
committerstsp <stsp@openbsd.org>2017-07-22 16:54:46 +0000
commit602e12dd708d2ca53c2182f094db6bc3f233efa3 (patch)
treeb1205eba06c605da7092e4c0082cc910394e7284
parentAdd frame length range checks to the input path of iwm(4). (diff)
downloadwireguard-openbsd-602e12dd708d2ca53c2182f094db6bc3f233efa3.tar.xz
wireguard-openbsd-602e12dd708d2ca53c2182f094db6bc3f233efa3.zip
Make the kernel panic if an invalid state transition occurs in net80211.
Triggers on driver bugs such as those which were fixed in rsu(4) recently. ok kevlo@
-rw-r--r--sys/net80211/ieee80211_proto.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
index 82cfb091af4..2feebe1737f 100644
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_proto.c,v 1.77 2017/06/03 15:44:03 tb Exp $ */
+/* $OpenBSD: ieee80211_proto.c,v 1.78 2017/07/22 16:54:46 stsp Exp $ */
/* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */
/*-
@@ -981,7 +981,9 @@ justcleanup:
ni->ni_rsn_supp_state = RSNA_SUPP_INITIALIZE;
switch (ostate) {
case IEEE80211_S_INIT:
- DPRINTF(("invalid transition\n"));
+ panic("invalid transition %s -> %s",
+ ieee80211_state_name[ostate],
+ ieee80211_state_name[nstate]);
break;
case IEEE80211_S_SCAN:
IEEE80211_SEND_MGMT(ic, ni,
@@ -1021,7 +1023,9 @@ justcleanup:
case IEEE80211_S_INIT:
case IEEE80211_S_SCAN:
case IEEE80211_S_ASSOC:
- DPRINTF(("invalid transition\n"));
+ panic("invalid transition %s -> %s",
+ ieee80211_state_name[ostate],
+ ieee80211_state_name[nstate]);
break;
case IEEE80211_S_AUTH:
IEEE80211_SEND_MGMT(ic, ni,
@@ -1038,7 +1042,9 @@ justcleanup:
case IEEE80211_S_INIT:
case IEEE80211_S_AUTH:
case IEEE80211_S_RUN:
- DPRINTF(("invalid transition\n"));
+ panic("invalid transition %s -> %s",
+ ieee80211_state_name[ostate],
+ ieee80211_state_name[nstate]);
break;
case IEEE80211_S_SCAN: /* adhoc/hostap mode */
case IEEE80211_S_ASSOC: /* infra mode */