From nobody Sun Mar 8 17:07:33 2026 X-Original-To: dev-commits-src-all@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 4fTRQy4Kyvz6TSkZ for ; Sun, 08 Mar 2026 17:07:38 +0000 (UTC) (envelope-from git@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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fTRQy3ms3z3vbt for ; Sun, 08 Mar 2026 17:07:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772989658; 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; bh=dKdUzirvCzxUz/LDe+IgzGcABACxRXbuDEl5l4OkrvY=; b=kJFNJvoB0PkDUQGwJNYob1rIVYyb4G+qtcyQUdRqXbjyrAFFLjue3xpQkdWO0t32ftmNOg myBjw0RMLxZXNfWkL0feCfWbV79cJUY5bevxap15/nCpWMzZDXeZywtg7F4OPpz/Se4Jep fHGZ211hGBdHpwgk5TIikuCaLrlROVq/8c7x2g6HHlNW3sS05PnOWs/epkH3K9V8DEMJPT iz8m4EgCW8BijMzw6i9LRm2HxInj0KRwe72vG2X5BMcwOPg8H9HkS1aTCPwmm/jeDWe9Ak 6I4mFofVoXX6U7zTDNWBHLCo+SuyaO9AuDon4hQP1xDJ1SXPU7pTFB9/1dt9cg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1772989658; a=rsa-sha256; cv=none; b=wrQ3B3o2iNxfIsmlgAb4Fgeqr8JIGnXZtKvxMZzJyX62EcuyYKC7T62bfNXonrfSVBax/6 oTDWBh/aW/Qj/kdRgqQJ8jhBPEiNiutJpLUkTYdW2wjU9/ODdku256foE511KZC8BfFKgM VXLrRiU1v3D7Tk0YVQeYXYIh55rn1AdlvlJY7rMEA3rxRcxVScOR817kLvx1e+a50fGEI6 9qawq7dSePlf3/CCaOCSanTcrkAv3l2G76/efhfzvvte07sh1VEcNyIX1w+bPSoeZbGPkV s9OgzxmkfYclmtnlxOk42T3YGdp95FJOoP4lXVyEII6cekXLtTR6F5oEnE1yuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772989658; 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; bh=dKdUzirvCzxUz/LDe+IgzGcABACxRXbuDEl5l4OkrvY=; b=KA9P5whzDgwXWcObJhQomuZ54KXMEqFUkMQZfboAbSzXtdMNqQOD7IVzRwgFM+LD2HRxFC YhDMlBcRZFBjm6jBzikq8oarexe2cGYQxOvjFUDwh5tbQDXslWFyu23VyCnfpROryKzGhl NJby3ROjBxiGMT1no9iOsEWamfYi/jtsXHXIpdQGq4DuFsYiRnDCC3sXc1EIZVe6iuLHxz Lzwpd38+vviDbgqr//I7LyPRpzmtMvfG7D+SwUuzKMBfRtmtPAHXCfHGBoOxwfcbM3QXm3 rdQqJB9umOJcpeLkQJnr2E7AFQ9U6HDO4Nt6VuuAwl1PJCntT0VRQ4RgYbyJRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fTRQy3F88z13ly for ; Sun, 08 Mar 2026 17:07:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 433ce by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 08 Mar 2026 17:07:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 53c69fd933dc - main - LinuxKPI: 802.11: lkpi_sta_auth_to_scan() fail graciously on lsta == NULL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53c69fd933dc49f69d5603fb27ce51064ebe681e Auto-Submitted: auto-generated Date: Sun, 08 Mar 2026 17:07:33 +0000 Message-Id: <69adacd5.433ce.68a3fd9c@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=53c69fd933dc49f69d5603fb27ce51064ebe681e commit 53c69fd933dc49f69d5603fb27ce51064ebe681e Author: Bjoern A. Zeeb AuthorDate: 2026-03-08 12:48:51 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-03-08 13:49:52 +0000 LinuxKPI: 802.11: lkpi_sta_auth_to_scan() fail graciously on lsta == NULL Usually after a firmware crash, we see reports of crashes in lkpi_sta_auth_to_scan(). One of the last ones was in the PR mentioned below. These crashes are often attributed as the problem while the real problem happened before. At this point try avoid the NULL pointer and to fail graciously if lvif->iv_bss (lsta) is no longer set. This way users have a chance to possibly recover using netif restart wlan0 rather than dealing with a panic. See if this helps us to better track down the original problems rather than the follow-up crash. On a debug kernel the KASSERT should normally have caught that condition as well but we see panics on page faults were the log line was there but then the lsta->ni deref has happened, which is after the KASSERT. I have not checked if this is a reordering problem or if the people reporting had IEEE80211_DEBUG on but not INVARIANTS. Sponsored by: The FreeBSD Foundation PR: 286219 #c11 MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 63f92b8afb2b..01347586ef63 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3215,16 +3215,28 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int wiphy_lock(hw->wiphy); LKPI_80211_LVIF_LOCK(lvif); -#ifdef LINUXKPI_DEBUG_80211 - /* XXX-BZ KASSERT later; state going down so no action. */ - if (lvif->lvif_bss == NULL) - ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " - "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + /* + * XXX-BZ KASSERT later; state going down so no action in theory + * but try to avoid a NULL-pointer derref for now and gracefully + * fail for non-debug kernels. + */ + if (lvif->lvif_bss == NULL) { + ic_printf(vap->iv_ic, "%s:%d: ERROR: lvif %p vap %p iv_bss %p " + "lvif_bss %p lvif_bss->ni %p synched %d; " + "expect follow-up problems\n", __func__, __LINE__, lvif, vap, vap->iv_bss, lvif->lvif_bss, (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, lvif->lvif_bss_synched); -#endif - + LKPI_80211_LVIF_UNLOCK(lvif); + /* + * This will likely lead to a firmware crash (if there + * was not one before already) and need a + * ieee80211_restart_hw() but still better than a panic + * for users as they can at least recover. + */ + error = ENOTRECOVERABLE; + goto out; + } lsta = lvif->lvif_bss; LKPI_80211_LVIF_UNLOCK(lvif); KASSERT(lsta != NULL && lsta->ni != NULL, ("%s: lsta %p ni %p "