From: stsp Date: Sat, 2 Sep 2023 09:02:18 +0000 (+0000) Subject: Avoid trying to remove keys if the station is not active in iwm firmware. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=296f586bac05bd565cfeb0e5757bba74fb647b8f;p=openbsd Avoid trying to remove keys if the station is not active in iwm firmware. Same fix as applied to iwx(4) in March. Since iwm(4) does not use a task for key installation and removal the same race might not manifest here. However, trying to delete a key while the station is not in firmware is wrong in any case. And this code might get moved into a task later. --- diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index 06a8a6491df..fc4bc1adc8f 100644 --- a/sys/dev/pci/if_iwm.c +++ b/sys/dev/pci/if_iwm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.409 2023/09/02 08:57:46 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.410 2023/09/02 09:02:18 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -9206,6 +9206,9 @@ iwm_delete_key(struct ieee80211com *ic, struct ieee80211_node *ni, return; } + if ((sc->sc_flags & IWM_FLAG_STA_ACTIVE) == 0) + return; + if (!isset(sc->sc_ucode_api, IWM_UCODE_TLV_API_TKIP_MIC_KEYS)) return iwm_delete_key_v1(ic, ni, k);