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=1796388263; b=W/gWz1OiTWzTuI5Gxa/6363T6RxTGYUHTIixxR7ouYbXtQDanqxoCfSxWVDllcfWRWvq qJNMwBVqSsNQ0DQz1Ca9rB7iiiff0gUAn9/S7vAnu5/l/COrmXy6lq3LyMAK5iOlyblO8 zh46zEZa5kToZIv+OUYEIHFU8YMOKvGDacKHhvhLYKp9q1F9K4u0Xni9ox31S+BGzw7J4 gaota8LPl0cQ1HvNChIDqXJFz7ZQZ3QmcHvSeljk2xvmFyXRjgM/zhIHG6xq3scM3ifkG upgkt+7K6aeigpR/KfFPa/KpyfJo8AzMqh9wqzUYkEZ2bYWZOZymQbKFoBGbsng+XGw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388263; 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=bfNI/RihsW6rgaEBsY3PsKZ8qTJpLj8FKg7geJUFgYY=; b=mPWwfxzxvKcgPBtciY/bg0YrXA4OpQgF3liJfgXKJJhaqYif3fuve4y8rf20cHzI3DsM Ocvf0NGmrC11dZVI1ZAekk0kcDbdI44qkWyP3c3IkFILBQmNPEaaQ2GemF/+bH1LIcRNN J3wUvlOI1ysnlFIO7zlypuhLsidv8uP2V8js+TY3n0t71ApvvwCivABPCOwymecNY359p zE6XjJW3aj16M06SRlefePR5UMVYw+XRTj9OPe4vQsuQvOuWgPrKK6/p3W8kyAI0w+/II W0wBweOywXkE2XirCUVUc4oVdvLIC60LP7RjsuHEzmEWDEZ6r5sRsQQdDOn07S3fZHA== 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=Miqx6eC+; 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 DCD50606A330; Fri, 4 Dec 2026 12:44:23 +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=Miqx6eC+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 565191F0092C; Fri, 4 Dec 2026 12:44:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388263; bh=bfNI/RihsW6rgaEBsY3PsKZ8qTJpLj8FKg7geJUFgYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Miqx6eC+D0Zye1kH9JkqpOQp94NJN+mdxF6WRGAAkyO/fRkWB4na0ixaX4H4lb4Xq CVzXJ/W2ZTudi2nTCr6lF2XfU6cP+WeFRccBicNuM4wZPoIFggNKbuK1TwHgvXjrZW 7OxrrsY5eE3M2+hloUBKQLTQBPjDQXUAEplxmmNc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zhao Li , Johannes Berg Subject: [PATCH 6.1 0549/1059] wifi: mac80211: bound pending IBSS station allocations Date: Fri, 4 Dec 2026 19:01:20 +0900 Message-ID: <20261204100658.414232516@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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 @@ -704,6 +704,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); @@ -1231,9 +1232,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]; @@ -1701,6 +1711,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 @@ -589,6 +589,7 @@ struct ieee80211_if_ibss { spinlock_t incomplete_lock; struct list_head incomplete_stations; + atomic_t incomplete_sta_count; enum { IEEE80211_IBSS_MLME_SEARCH,