From nobody Thu Nov 09 23:45:29 2023 X-Original-To: wireless@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SRJVM164Mz517kn for ; Thu, 9 Nov 2023 23:45:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SRJVL5Ws6z4VVc for ; Thu, 9 Nov 2023 23:45:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699573530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LccuG5+7PzDvtvda1Za8K2EAekyqq55Gf/S/0zviprs=; b=NuxEKJvzWjttRP2IdDQzWOBgs9Erh7zoCWswvt9eh1aqkN14KEO90Z+pE40AY8E6GNKE0n N4glAdROiKMjzMMwwdzaxE6fKS0uiEsLv1Ly1OmHGwesMTda4RGLtgz6t9gIUOd7hDtPFm a91xjHUZ2cu+pPa+4Z/5/omXrze1w2s6CTbi1n9eSe4sy3y2Rs6nGMwM9raXiRhmt3EQqm ogy0Ha2x9RWiFCuuE57I5JoanxhXjkotP7RQoVEvrvqKPGOT+fdoTztdNQI+G4ItCBlQUE Y/mPEbCikQbaHHknkU7xtauSbom4XTxC8lP2qzwn5Ucp2RFf4u0JRi/tGqU7uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699573530; a=rsa-sha256; cv=none; b=olpu1lQ7+FpcbGokrOYziD4ktY6J5Y+2cStmo/R7FVri4g3kDYKjp8jUqwZh2YwZRXdW3R FTS5HtNax5TBWtJk28JTl6jfeR2cqEZ2fzZazTfi2ee7zxQQMAca+s8eY7JAlaCer4P7m8 QKEBaTBPl5RVPfZrWBnyarKHzenMK8NEShRmWk7NBle5zvlnzWyf/AUnvMcWsa9PlHFXru HXP4lO0e229dQYJXtf/BH1Yqpd4MyRLOaB/zMJJ9Zceo4r8BhXYvCA5YnwWCv1oXWKDw/h qsCUG7iElE8PhDLsAe1SCxgXdUQH6cABfztazJhRW3YNtMNsjiXgufYc6J+WSA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SRJVL4TrYzbps for ; Thu, 9 Nov 2023 23:45:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 3A9NjUDF020233 for ; Thu, 9 Nov 2023 23:45:30 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3A9NjUV8020231 for wireless@FreeBSD.org; Thu, 9 Nov 2023 23:45:30 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: wireless@FreeBSD.org Subject: [Bug 271979] bsdinstall(8): iwlwifi(4): system crash when authenticating for Wi-Fi: panic: lkpi_sta_auth_to_scan: lsta 0x... state not NONE: 0, nstate 1 arg 1 Date: Thu, 09 Nov 2023 23:45:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: crash, install, needs-qa X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: bz@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bz@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussions List-Archive: https://lists.freebsd.org/archives/freebsd-wireless List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271979 --- Comment #29 from Bjoern A. Zeeb --- (In reply to Cheng Cui from comment #28) Ok, based on the wlandebug +state and the additional logging from [1] here's the race in net80211 affecting possibly all drivers: [1] https://people.freebsd.org/~bz/wireless/20231109-01-net80211-newstate-loggi= ng.diff >>>> ANNOTATED OUTPUT from Comment 28 [https://bugs.freebsd.org/bugzilla/sh= ow_bug.cgi?id=3D271979#c28]; hope we can confirm this with time stamps on. wlan0: sta_newstate: INIT -> SCAN (0) Starting dhclient. wlan0: no link ..... [1] wlan0: ieee80211_new_state_locked:2746: starting state update SCAN -> S= CAN (AUTH) [1] wlan0: ieee80211_new_state_locked: SCAN -> AUTH (arg 192) (nrunning 0 nscanning 0) [1] wlan0: ieee80211_newstate_cb:2517: running state update SCAN -> AUTH (1) [1] wlan0: ieee80211_newstate_cb: SCAN -> AUTH arg 192 LinuxKPI running lkpi_sta_scan_to_auth() around here... wlan0: [f4:69:42:57:3f:0e] station assoc via MLME ioctl logging, triggering ieee80211_sta_join -> ieee80211_sta_join1 -> ieee80211_new_state(vap, AUTH, IEEE80211_FC0_SUBTYPE_DEAUTH=3D192) -> [2] ieee80211_sta_join() would allocate a new node (ni) and lsta in LinuxKPI. ieee80211_sta_join1() would then call iv_update_bss() and that would swap nodes. That explains the previous error Colin saw with the queue not having the va= lid node anymore and also explains why we later panic as the state is not corre= ct anymore. If the assumption is correct a KASSERT in iv_update_bss() could probably ca= tch this. I'll post a patch for that as well. I have a big XXX in that code anyway because of this. [2] wlan0: ieee80211_new_state_locked:2731: pending SCAN -> AUTH (now to AU= TH) transition lost [2] wlan0: ieee80211_new_state_locked:2746: starting state update SCAN -> A= UTH (AUTH) [2] wlan0: ieee80211_new_state_locked: SCAN -> AUTH (arg 192) (nrunning 0 nscanning 0) LinuxKPI calls into the original handler for [1] which means lkpi_sta_scan_to_auth() is done: [1] wlan0: sta_newstate: SCAN -> AUTH (192) here iv_state gets updated from SCAN to AUTH, [2] wlan0: ieee80211_newstate_cb:2517: running state update AUTH -> AUTH (1) [2] wlan0: ieee80211_newstate_cb: AUTH -> AUTH arg 192 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^= ^^^ The [2] SCAN -> AUTH turned into AUTH -> AUTH; a further (LinuxKPI runs lkpi_sta_a_to_a() possibly mgmt protection problem given our sta_to_auth has not finished yet -- if we had a reply and moved to assoc; cc@ to test, which would explain the PR in the next line): Invalid TXQ idiwl_mvm_tx_mpdu:1204: fc 0x00b0 tid 8 txq_id 65535 mvm 0xfffffe00b1250408 skb 0xfffff80007865800 { len 30 } info 0xfffffe00745dcce8 sta 0xfffff80005760880 (if you see this please report to PR 274382) wlan0: ni 0xfffffe00b15bf000 vap 0xfffffe00b12e0010 mode STA state AUTH m 0xfffff800078b1b00 status 4543576 wlan0: ni 0xfffffe00b15bf000 mode STA state AUTH arg 0x2 status 4543576 [2] wlan0: sta_newstate: AUTH -> AUTH (192) should call sta_authretry(, with 192 >> 8 =3D=3D 0 =3D=3D IEEE80211_STATUS_= SUCCESS) -> Sends another b0 (authentication). wlan0: ni 0xfffffe00b15bf000 vap 0xfffffe00b12e0010 mode STA state AUTH m 0xfffff8000773cb00 status 1 --=20 You are receiving this mail because: You are on the CC list for the bug.=