From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 004831EDA0F; Mon, 23 Jun 2025 21:29:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750714143; cv=none; b=Lw7yKIJt+VDRcDPM1ab1lAo8my8mp33KeYatFQRYyk5Lw6dMwm1WbovU4Y4IjzC5NONPPFi2gR9ed69Z5B19GWUFMWsqP08MgdEFOCbRjmECJliSxHS9F9qcawJpMaVIkUM/sSsgytrF8/NPRw6CvhLRnT0n3n68VtXIIV78Raw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750714143; c=relaxed/simple; bh=tVCH850FGDG+orM3fqlfvoeGPw8nDYJEXcskEby89IY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gp+NPZLZdrwbQwfapnUELdiCC/jSu+x5MOvLyqvFYGAmktCo6wtVN6544HWCjSg6jrugPudQqcsZWrU3J04xUTxXZIJkM1D4vEHPlool9fCziDce2yf3YN417MdOl6kXsZl8xHbwUAHMJ0t+gcKsixIMDDPEvFQFNJLBT4sNWng= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=unwiIhPF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="unwiIhPF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83D03C4CEEA; Mon, 23 Jun 2025 21:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750714142; bh=tVCH850FGDG+orM3fqlfvoeGPw8nDYJEXcskEby89IY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=unwiIhPFTndchg3gZNii5KFAvpvUicguoTu+6qP3hFXrnXet72l46qEhn8uJT+OTu 4bbrQjDLxrLZgabZ2hnaKFQ6HD08eNVdnN9rP69T6paT7AgYY6zosjskfbEHoLusWD lhWTrpC9K+Ny/TGJhTq7pWNqm+kzxKEwLNfsMX6Q= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Benjamin Lin , Shayne Chen , Felix Fietkau , Sasha Levin Subject: [PATCH 6.6 139/290] wifi: mt76: mt7996: drop fragments with multicast or broadcast RA Date: Mon, 23 Jun 2025 15:06:40 +0200 Message-ID: <20250623130631.085263973@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130626.910356556@linuxfoundation.org> References: <20250623130626.910356556@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Benjamin Lin [ Upstream commit 80fda1cd7b0a1edd0849dc71403a070d0922118d ] IEEE 802.11 fragmentation can only be applied to unicast frames. Therefore, drop fragments with multicast or broadcast RA. This patch addresses vulnerabilities such as CVE-2020-26145. Signed-off-by: Benjamin Lin Signed-off-by: Shayne Chen Link: https://patch.msgid.link/20250515032952.1653494-4-shayne.chen@mediatek.com Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7996/mac.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c index 35d9673ec0d8f..8fa16f95e6a7b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c @@ -650,6 +650,14 @@ mt7996_mac_fill_rx(struct mt7996_dev *dev, struct sk_buff *skb) status->last_amsdu = amsdu_info == MT_RXD4_LAST_AMSDU_FRAME; } + /* IEEE 802.11 fragmentation can only be applied to unicast frames. + * Hence, drop fragments with multicast/broadcast RA. + * This check fixes vulnerabilities, like CVE-2020-26145. + */ + if ((ieee80211_has_morefrags(fc) || seq_ctrl & IEEE80211_SCTL_FRAG) && + FIELD_GET(MT_RXD3_NORMAL_ADDR_TYPE, rxd3) != MT_RXD3_NORMAL_U2M) + return -EINVAL; + hdr_gap = (u8 *)rxd - skb->data + 2 * remove_pad; if (hdr_trans && ieee80211_has_morefrags(fc)) { if (mt7996_reverse_frag0_hdr_trans(skb, hdr_gap)) -- 2.39.5