From nobody Tue Apr 29 11:41:42 2025 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 4Zmz1P1pSSz5tvJ0; Tue, 29 Apr 2025 11:41:45 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zmz1M002Vz3wnt; Tue, 29 Apr 2025 11:41:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745926903; 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=YZujqNVaSc/Ty/26PMVPRaTHxXb6BhOgmpYkc1x4jQY=; b=X5hgHCUt35tsvLmBUnZG7sc/jQnTQ/8IynbpqHksryyjG9ZgKw+hHGOSBDU4kfa+4vCIMn XTS8w+g/3HtbOusb/+7llFGkZRKSF1pEiNSOXT9HUJOTCz/XxKNl0gA2XuzN29Fa8FgjLr CAy6hJolscNFVXY7pxKzMABh7eozApx7Fqh3u+xEAHOLsm6/NBv+h3B5wow5Jw7D8fcLo6 ryfWjxeIdcX9KgoESxiyDYI5nrELgs5upgeX/bElnUrnf7U3XNOTZKyfhlmzocnDik753V alqeus+lIZaRspJ+Zql1vBBZwDzhhmbkIMWKwgWqch05HLzRKRAgUjyDi4vvcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1745926903; a=rsa-sha256; cv=none; b=fwe6hU71XXOlp2hTVhjqoBoEYoDcIjmRWIlH6DhMwz59yAAfv+mMimlEoLpmupWpFIfs1T 6VLMyPbdDVrcjD4DlDQQbsy+GNTwbe/nycioHxkkNFIcilz13k6TCJoELpE/cPUiEPMy8v lgqm+jsfmzigTEiCu8uYZK0N7/Pkc/87Qr5eWvmUrthcnEAzJfMGMijRgM5Z8Ws3hHHCZj KoUVAEceHYIFeWqPxA8eCBulkjmlFpFDe4qnmSJYK7spSi8r2/uXwu2AN+w3cxrj13agNU /hzGt4NmiNe87ZAEtumWWCqFOgAuOeklVH6Yz2Nib+iVmsQy0WL44Wkc4qK6XQ== 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=1745926903; 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=YZujqNVaSc/Ty/26PMVPRaTHxXb6BhOgmpYkc1x4jQY=; b=GszV6CPA0lpAEElM6ftds1cO3yy7jJ3dQp2TnsC/Hx0Kyzk3+FXeVRfuoAufLMRc2rTOHP t3Guz1ocXGFNMq/FTaFpM/K8/Kc4yzaBVZImwg53w2JSrz4DKBe3oLQsN0GToIqIyu+wwm uz1FNyStFKQaqXv4HbksRkQTBizLCEVoT3OOxbuSNxRsgTK/e0OMYRUrqRHUy1A2Hzibk2 2TpkVE9qRWZf4Hhi3SmwsSbjw+knxWSqx7e+cuPsjBujdD7Y7iKhS6gGI/BH3SgLyPB7Kf 6YnyIhotETU2gJqKLYT/+ilLU8DzCbO39PqdXdKgLTlSyVYD7GYJ7RF6kbHEQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4Zmz1L6dKvz3wJ; Tue, 29 Apr 2025 11:41:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 53TBfguU045928; Tue, 29 Apr 2025 11:41:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53TBfgij045924; Tue, 29 Apr 2025 11:41:42 GMT (envelope-from git) Date: Tue, 29 Apr 2025 11:41:42 GMT Message-Id: <202504291141.53TBfgij045924@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: fec21aaf328d - stable/14 - LinuxKPI: 802.11: no need to lock during lkpi_lsta_alloc() 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/stable/14 X-Git-Reftype: branch X-Git-Commit: fec21aaf328d90ffd87f8e508ad19393e555a9d4 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=fec21aaf328d90ffd87f8e508ad19393e555a9d4 commit fec21aaf328d90ffd87f8e508ad19393e555a9d4 Author: Bjoern A. Zeeb AuthorDate: 2025-04-22 19:52:19 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-04-29 10:49:29 +0000 LinuxKPI: 802.11: no need to lock during lkpi_lsta_alloc() Given upon sta allocation we do not adjust the chanctx in case of mismatch there is not need to lock here. This fixes a problem that upon shutdown net80211 once again can race into here replacing the node from a context where it is holding a lock which does not allow us to hold an sx lock (sleeping thread holds a non-sleepable lock). Sponsored by: The FreeBSD Foundation Reported by: ziaee Tested by: ziaee (cherry picked from commit dbc3b1cb4fa6d1f9ac7ac1e860179ce1b432cd70) --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 84241c2dd89f..f3464f370a13 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -777,9 +777,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20; sta->deflink.rx_nss = 1; - wiphy_lock(hw->wiphy); lkpi_sta_sync_from_ni(hw, vif, sta, ni, false); - wiphy_unlock(hw->wiphy); IMPROVE("he, eht, bw_320, ... smps_mode, ..");