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=1796388261; b=SYdTMqRqmt20s6I8K7/isvL891gbobpYjCqI1g790O2G6yyybV7/jh+0KCh7BSqtGg6g kSR5C1dmG0/NDceg4FCVqdbBSAcFQWzFuzFP1M9zeoVTqsTELwf1Vc5IosWwQ2wbMDlls BFi355DfK3lyNflxLrVOPOuN9hBVj+zFnj89mZSYjT7fwQfU0Ubi08bX4Qn2F29sTW2TX 6po2udVlYCXVRzKbFiQ1VRtkoDq20W7z75dSN0qm3OhUF3E8aImByy2dPCDSNxcIsYjLn t9UH050eG9XgLb+jm8yjj3Jo10p/tM2TfXmNPQ6KWvDBaEJPsc2GyLJSxbn3Z5yksWA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388261; 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=7DLTj4r2pXgqiVIptl8CAoDSa9wdxanUMHmvcKr6ppI=; b=wXCS0K2E3LSQ1DESa2d4oxlc+dBtp++GFGPECr6LugDqOruaBTziGBMIbFXmbCODhaL7 g/Q7O9o/GcRrRDyXoNgPttWzAPHTIL9bedCB2hesVpxhpTqbBg+jUwfZyOqKZQ0JiEHsL W6CYJdw0o0e1jIMVawm++JsyNXukwx9NrJW4nX74it+5NIDm7UCOcvXgNW0ogZBEtS5Bo jNc/3JrUiaCRakB/7n+6NprtwO77LpUSb0FjLI0+VqYvMj5Gv0VyvGRGRhb3aYH6IATxV 7/aboRwgEdKi5o9wYKnFyilMHfTTO4Q7UvZTPo0IIMoBNiG7213kykR1jv6awVJnzFg== 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=BHhzLoyS; 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 A03F7606A322; Fri, 4 Dec 2026 12:44:21 +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=BHhzLoyS Received: by smtp.kernel.org (Postfix) with ESMTPSA id 178781F00897; Fri, 4 Dec 2026 12:44:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388261; bh=7DLTj4r2pXgqiVIptl8CAoDSa9wdxanUMHmvcKr6ppI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BHhzLoySyu4n9R5iCI9hyK2/0Z80bc5+af6L7NlzI1odGviuYPp+3AgbA8LCFFlik 8e+bwF+3kxHPkAEwkHlTdAR1Y+xgoZEpMnaZUnEOQ0WMpHxSW7T3xRooruzLX16iBL a+MsuKn2OfwodafRkamFA051lLlkP3OAWmIo/dxk= 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 0548/1059] wifi: mac80211: recheck the OCB station limit before insertion Date: Fri, 4 Dec 2026 19:01:19 +0900 Message-ID: <20261204100658.390686429@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: 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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhao Li commit 27e29a077b4887d0e0a813337f8b7e06bd020c81 upstream. Frames from successive unknown OCB 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: 239281f803e2 ("mac80211: 802.11p OCB mode support") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028142302.16634-2-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/ocb.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/net/mac80211/ocb.c +++ b/net/mac80211/ocb.c @@ -139,8 +139,12 @@ void ieee80211_ocb_work(struct ieee80211 list_del(&sta->list); spin_unlock_bh(&ifocb->incomplete_lock); - ieee80211_ocb_finish_sta(sta); - rcu_read_unlock(); + if (sdata->local->num_sta >= IEEE80211_OCB_MAX_STA_ENTRIES) { + sta_info_free(sdata->local, sta); + } else { + ieee80211_ocb_finish_sta(sta); + rcu_read_unlock(); + } spin_lock_bh(&ifocb->incomplete_lock); } spin_unlock_bh(&ifocb->incomplete_lock);