wifi: wil6210: fix BSS reference leak on unsupported EDMG config
Subsystems (2)
PATCH 1/1 wifi: wil6210: fix BSS reference leak on unsupported EDMG config
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.
---
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(-)
drivers/net/wireless/ath/wil6210/cfg80211.c +1 -1
@@ -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
Signature · 1 line
2.50.1 (Apple Git-155)