From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385523; b=h2ec3Q4zNNMuDVg9JqeECP+x2yE7C1WmwBaGyOT1pORRZPyeQIX0yFBddXmm4kCx+bzq npuemHkoZZibIx3+Qfj6NlZzHxrNuylwtV+Ot9BqbVm4ugf2PdclINrFsN0Uf0Dxx37nm J02ZEW8YBBmbUq5lM3BU+At20NfezjjuXkqc/Vbm11h5K54LWWo3RrEwfYWwewqSQ9FI9 tug3UlVMS8el7vih0Ge+rAWK9no81a0WlWiznAE8urhdEoayBAMgZv5P9yVPNTzfIurGM ECIWJGtP8VRcg5oYducZXgxTXOQtwOEaN0AKVSDPCSFI1X4qipqlVP+BH46BUQtblMg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385523; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=D0r2g1hXmlY3W/ly7kqbNDjw0Kr/m95OawKzyg7W4V4=; b=4ka8nm4ifl2DMRs0j7C5uDF7J/RUTzgj98Id2wd/cgdkI/kHifBMt4LKYyBGecWS9D/y N3ptbM67sEILLQiCy0xrqk4Ju/7NhJEhRsrNVBl6c2nc2j9oitWu3kTkIVqiSRK43NIJs ka/jKXVFWpPMt5SPCsccaoJ5Zqc0OzTLNZb/D6m+iUwdA2dh64G8/1Kk587Rm1xdxDeYb v/AfZE5CJneINa1GP1AqscDLtFkccgxJDAeYYby1pj78ttMk6wG1m+E3LzygGKXbYTznV OznBCUmmEVTh8VJI7FEwKTd9qn8bjHYjEj2WMachdZgc38FPOvUTv3gyxKr1cgmc3hQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=DFa14wLy; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C2E0606A336; Fri, 4 Dec 2026 11:58:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=DFa14wLy Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2327E1F0092C; Fri, 4 Dec 2026 11:58:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385522; bh=D0r2g1hXmlY3W/ly7kqbNDjw0Kr/m95OawKzyg7W4V4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DFa14wLyWKDCuMhUNLN8dCKiMds6eyMBw5w8qJdXQ0DjQmbqjGLY1okNM4GQvhDVm Ugg67G78D70zhSxWPUcpWH0aUg6rngK1ktDlWpiUV/W25+GhyuLTld2eNTq5xnyOeV DMOz8p0Q2UhcNSscwcHmpz0DLSPy5sXmxNp/C9mw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zhao Li , Johannes Berg Subject: [PATCH 6.6 0584/1167] wifi: mac80211: bound pending IBSS station allocations Date: Fri, 4 Dec 2026 19:00:11 +0900 Message-ID: <20261204100717.262877737@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhao Li commit 3029ca2112d7bee4d3e3eadd02decdb3eddb9485 upstream. Delaying the IBSS station worker while frames arrive from new peers can retain an unbounded number of station allocations. The receive-side limit counts installed stations, while new allocations wait on incomplete_stations until process context inserts them. The list lock does not cover the interval between allocation and list insertion. Reserve one of 128 pending slots per interface before allocation. Release the reservation on allocation failure, after the worker inserts or frees the station, and when disconnect frees the pending list. LLM assistance was used to find the bug and review. Fixes: 8bf11d8d0811 ("mac80211: delay IBSS station insertion") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028142235.15428-3-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/ibss.c | 13 ++++++++++++- net/mac80211/ieee80211_i.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c @@ -707,6 +707,7 @@ static void ieee80211_ibss_disconnect(st spin_unlock_bh(&ifibss->incomplete_lock); sta_info_free(local, sta); + atomic_dec(&ifibss->incomplete_sta_count); spin_lock_bh(&ifibss->incomplete_lock); } spin_unlock_bh(&ifibss->incomplete_lock); @@ -1235,9 +1236,18 @@ void ieee80211_ibss_rx_no_sta(struct iee scan_width = cfg80211_chandef_to_scan_width(&chanctx_conf->def); rcu_read_unlock(); + if (!atomic_add_unless(&ifibss->incomplete_sta_count, 1, + IEEE80211_IBSS_MAX_STA_ENTRIES)) { + net_info_ratelimited("%s: No room for a new IBSS STA entry %pM\n", + sdata->name, addr); + return; + } + sta = sta_info_alloc(sdata, addr, GFP_ATOMIC); - if (!sta) + if (!sta) { + atomic_dec(&ifibss->incomplete_sta_count); return; + } /* make sure mandatory rates are always added */ sband = local->hw.wiphy->bands[band]; @@ -1705,6 +1715,7 @@ void ieee80211_ibss_work(struct ieee8021 ieee80211_ibss_finish_sta(sta); rcu_read_unlock(); } + atomic_dec(&ifibss->incomplete_sta_count); spin_lock_bh(&ifibss->incomplete_lock); } spin_unlock_bh(&ifibss->incomplete_lock); --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -591,6 +591,7 @@ struct ieee80211_if_ibss { spinlock_t incomplete_lock; struct list_head incomplete_stations; + atomic_t incomplete_sta_count; enum { IEEE80211_IBSS_MLME_SEARCH,