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=1796385511; b=NLrpicIHLsKx+bINxrtpwb+alYQDhvE42nPHruAY4yk+yHobtA3+PnEuw548N4HEnKng nDg/kO7Mie/6uq80BGGk+J2Rj1yVUDmsAIb87bw9zPN17fp3Lv/WY0JYWemIloRhd1ECx CB5Hq7DLp6n9OzHI55Cj4OH1EZsUnxuaQ8dIMdFv6iF/99qPRBxZT0l5BD3KlrewXcGZ4 ePfhPtBoXc3Up6rSwOeSV/ux3mM8WZdByz8XP8nFyNrbi9zI7CKKDMZeT0AgvEX3XemyL wJM+NmKrLROjzVj4DDEa9sxKjwuK8LFSa4SJeNq7oP/E3xhqxRaed2WbEzU7FGCYkpg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385511; 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=3vi3c53Ao7L/TwqLmq5eUx12EMN0ooaV5YRZWNAkPCw=; b=4NCVw1uwCiLIhSgSPL99pIswHOVHv+a5fSY7ESRrX+jB5nZLfIsxequyIIFyG4W6Tigp wMC+3zrCPl+/jpW4/CsDD+Fu0iT8R1PxIa/0wMxLTg0apVUk48yuJF3HrE9Fi9ZvfK3lu LRehkwCp1RvjXwvPh0GWb/oQYxmup/7dY4IcZ0MfTCHTffWtBx/xeKRYcUntCIrfrZFP2 ztgrZxyk0N70JoDQqcKE7+4bnDFpv4Kiljl4/3alME92LchvmMrlTlI4iPP4T75O0Jm2F njyyhB327HonnZW8/LgsNj3DPfqH/vAmAb5rB1Hc+cQ7wpFRK5bFSQridDW5yzQGdAA== 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=j27qHJP+; 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 3D8DC606A32C; Fri, 4 Dec 2026 11:58:31 +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=j27qHJP+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95CB91F00A0A; Fri, 4 Dec 2026 11:58:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385511; bh=3vi3c53Ao7L/TwqLmq5eUx12EMN0ooaV5YRZWNAkPCw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=j27qHJP+HxcgyTga1Wa90RSQiXhHOhpysXkcms68gZ1xp7p07HJR12zUXNigG9Fgh Bqv2QbT66HdIHw0G3xntGKvW1PD+Bnj9+l9vDOkn2qrSZnR2EgB4IOwVXEvhG4L+vh IkAWBTniUqI/O4MMTYVN+SrEWncF1eVCraIuuM2U= 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 0581/1167] wifi: mac80211: recheck the IBSS station limit before insertion Date: Fri, 4 Dec 2026 19:00:08 +0900 Message-ID: <20261204100717.183445002@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: 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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhao Li commit f7670bcdf650b37551a9c5d084521f877d939f11 upstream. Frames from successive unknown IBSS peers can make the deferred worker install more than 128 stations. The receive path checks local->num_sta before allocating each station, but pending stations are not included in that count. Several allocations can therefore pass before the worker inserts any of them, and the worker then drains the list without rechecking the limit. Recheck the installed-station limit in the worker under the wiphy mutex and free entries that no longer fit. 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-2-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/ibss.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c @@ -1699,8 +1699,12 @@ void ieee80211_ibss_work(struct ieee8021 list_del(&sta->list); spin_unlock_bh(&ifibss->incomplete_lock); - ieee80211_ibss_finish_sta(sta); - rcu_read_unlock(); + if (sdata->local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) { + sta_info_free(sdata->local, sta); + } else { + ieee80211_ibss_finish_sta(sta); + rcu_read_unlock(); + } spin_lock_bh(&ifibss->incomplete_lock); } spin_unlock_bh(&ifibss->incomplete_lock);