From: Yige Jiang <yigejiang86@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: Yige Jiang <yigejiang86@gmail.com>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH] wifi: wil6210: fix BSS reference leak on unsupported EDMG config
Date: Wed, 25 Nov 2026 17:06:18 +0800 [thread overview]
Message-ID: <rc-b1-20261110-vc-35-5e6ef2ea7917@gmail.com> (raw)
wil_cfg80211_connect() takes a reference on the target BSS with
cfg80211_get_bss() and drops it with cfg80211_put_bss() at the out
label. Every error path after the lookup jumps there, except the one
for wil_get_wmi_edmg_channel(): when the requested EDMG bandwidth
configuration or channel bitmap is not supported, the function returns
directly and the BSS reference is never dropped.
Each such connect request leaks one reference, so the BSS entry is
never freed, even after it expires from the scan list.
Jump to the out label instead, like the other error paths.
Fixes: 9abe3e306ecc ("wil6210: Add EDMG channel support")
Cc: stable@vger.kernel.org
Signed-off-by: Yige Jiang <yigejiang86@gmail.com>
---
Based on linux-next next-20261109 (630059a5a632).
Compile-tested: arm64, GCC 14.2.0, W=1, CONFIG_WIL6210=m, CONFIG_CFG80211=m, CONFIG_COMPILE_TEST=y; baseline and patched cfg80211.o, no new warnings.
No hardware or runtime test was performed.
AI assistance was used for analysis and patch preparation.
The path needs a connect request (CAP_NET_ADMIN) with an EDMG config the driver rejects, to a BSS already in the scan table.
drivers/net/wireless/ath/wil6210/cfg80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index bf060281c9a2..0d256f313511 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -1356,7 +1356,7 @@ static int wil_cfg80211_connect(struct wiphy *wiphy,
rc = wil_get_wmi_edmg_channel(wil, sme->edmg.bw_config,
sme->edmg.channels, &conn.edmg_channel);
if (rc < 0)
- return rc;
+ goto out;
ether_addr_copy(conn.bssid, bss->bssid);
ether_addr_copy(conn.dst_mac, bss->bssid);
base-commit: 630059a5a632377b9b7b487baccde92b7ae1dd47
--
2.50.1 (Apple Git-155)
reply other threads:[~2026-11-25 9:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=rc-b1-20261110-vc-35-5e6ef2ea7917@gmail.com \
--to=yigejiang86@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox