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=1796385497; b=rGW/ykCgOQgxLtuxJdKABkKNfpjiauwHMPmP5LM31UqFimHmijFtPzDnNFR8CO18X4DD SeOR9gSxSOzLAgrtl6CsdzzyTXLTw7GuUs/rE83IDB20tvHg4EHCKFQgHrbmJGTn6HlGx 9SZM0Lnpy0eoBxdlLDtHDf3ovfCBPcO5Izg9DhGR4iXFZbptHHZWP5a7ZeKYKCTMsICrs b/6lVZbm/Secqf/2ZiIDy09ABHhEtsFry9M2UZaxm+7EbUGsrybGKdU3OaXkYsNTt6NCn XBeXP++f1rFoDjXFpeYqLl94JLsXICtimyIpaXe1IpM3T92JvXdX9EtGU1v7wYSCSzQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385497; 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=/vtFoSXZzeBR1oRkOu0lGwSpv5I7t6/i4DEPpUIhfdw=; b=kIcTX6PM+NrcWxrAQ7DRmAlxC8mmCuqWU0Ro151ZOz5QZ+3nRFNcO4JYaNVurKvfkmcy U2INg2RWm2AU67k1QC8tmXtZ7E5VHtRJs1SSPE4COc/QH2+No8vgTKsTGk9nVWRorTEAv htX/tAEvnFFk1dILclVl/f8y8S6yWr5C++6aGyX45pbljbDMnIqZacszDJBfLAevG6OYQ reG0oLoWPuffzai6vSzONcjXRk+Lohuak4i+Yaup+lcP2t2VxdFtjVtWDZhXySfDIwCxF /KRm16H+HEGziNtbG6FT99kV21XZXKflWEgYvdfI5qvrGbDTq+MO4clDiEI+uVyvd/Q== 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="taaoe/37"; 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 416CE606A680; Fri, 4 Dec 2026 11:58:17 +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=taaoe/37 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A30E71F00A10; Fri, 4 Dec 2026 11:58:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385497; bh=/vtFoSXZzeBR1oRkOu0lGwSpv5I7t6/i4DEPpUIhfdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=taaoe/37BoucnXsr4cZFpLf5W2YHzotSRBqAVbtpKY6/REtzHeW0MpJxTfNWbFmWo A4zSyXqYpWP8HqVJJ5Usb48/EmfBEKPVDGXyXwvuiwokQ1zraoIEdOE4XTzbK7NjTX kYPRqZoVrVogQkyQyS3HOp7lq2RNz3n+J4DK6td4= 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 0576/1167] wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers Date: Fri, 4 Dec 2026 19:00:03 +0900 Message-ID: <20261204100717.056308365@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 9083da9dd3223068237395432323b407012aec1f upstream. A malformed mesh A-MSDU subframe with a declared payload length near 65535 bytes can pass validation against a much shorter aggregate. ieee80211_amsdu_subframe_length() adds the mesh control length to the declared length in a u16, and ieee80211_is_valid_amsdu() stores the result in a u16 local. The sum therefore wraps before either walker compares it with the remaining aggregate length. The decomposer then splits and delivers the malformed aggregate instead of rejecting it. Keep the computed length in unsigned int in both the helper and the validator so oversized subframes cannot wrap. LLM assistance was used to find the bug and review. Fixes: 6e4c0d0460bd ("wifi: mac80211: add a workaround for receiving non-standard mesh A-MSDU") Fixes: fe4a6d2db3ba ("wifi: mac80211: implement support for yet another mesh A-MSDU format") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028142149.13834-1-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/wireless/util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -778,12 +778,12 @@ __ieee80211_amsdu_copy(struct sk_buff *s return frame; } -static u16 +static unsigned int ieee80211_amsdu_subframe_length(void *field, u8 mesh_flags, u8 hdr_type) { __le16 *field_le = field; __be16 *field_be = field; - u16 len; + unsigned int len; if (hdr_type >= 2) len = le16_to_cpu(*field_le); @@ -805,7 +805,7 @@ bool ieee80211_is_valid_amsdu(struct sk_ __be16 len; u8 mesh_flags; } hdr; - u16 len; + unsigned int len; if (sizeof(hdr) > remaining) return false;