Date: Mon, 7 May 2012 20:28:50 +0200 From: Bernhard Schmidt <bschmidt@freebsd.org> To: Alexey Dokuchaev <danfe@nsu.ru> Cc: stable@freebsd.org Subject: Re: panic with if_iwi(4) upon "netif restart" Message-ID: <CAAgh0_aS-7EvM1QgQzOgUF4Hqhd3w394nxw=vzB6b-e2AeUe6A@mail.gmail.com> In-Reply-To: <20120507035405.GA47351@regency.nsu.ru> References: <20120507035405.GA47351@regency.nsu.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Mon, May 7, 2012 at 5:54 AM, Alexey Dokuchaev <danfe@nsu.ru> wrote:
> Folks,
>
> Weird panic occurs to me here with iwi(4) based laptop when trying to hook
> up to WPA-protected network with "service netif restart". Kernel and
> userland are not strictly in sync, with the latter lagging behind couple
> of months, but presumably this fact should not matter on stable branch.
>
> I was only able to get online by manually running wpa_supplicant(8) and
> dhclient(8). if_iwi(4) loaded after system fully boots (i.e. manually after
> login).
>
> [snip]
>
> Feel free to ask for more information.
does "ps" in kgdb reveal multiple instances of wpa_supplicant running?
If so, this seems to be the well known devd+netif+supplicant+newstate
race/missing refcount.
Wanna try attached patch?
--
Bernhard
[-- Attachment #2 --]
Index: sys/dev/iwi/if_iwi.c
===================================================================
--- sys/dev/iwi/if_iwi.c (revision 235132)
+++ sys/dev/iwi/if_iwi.c (working copy)
@@ -2811,7 +2811,7 @@ iwi_auth_and_assoc(struct iwi_softc *sc, struct ie
{
struct ieee80211com *ic = vap->iv_ic;
struct ifnet *ifp = vap->iv_ifp;
- struct ieee80211_node *ni = vap->iv_bss;
+ struct ieee80211_node *ni;
struct iwi_configuration config;
struct iwi_associate *assoc = &sc->assoc;
struct iwi_rateset rs;
@@ -2826,6 +2826,8 @@ iwi_auth_and_assoc(struct iwi_softc *sc, struct ie
return (-1);
}
+ ni = ieee80211_ref_node(vap->iv_bss);
+
IWI_STATE_BEGIN(sc, IWI_FW_ASSOCIATING);
error = 0;
mode = 0;
@@ -2982,6 +2984,8 @@ done:
if (error)
IWI_STATE_END(sc, IWI_FW_ASSOCIATING);
+ ieee80211_free_node(ni);
+
return (error);
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAgh0_aS-7EvM1QgQzOgUF4Hqhd3w394nxw=vzB6b-e2AeUe6A>
