Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2687833pxj; Mon, 31 May 2021 08:16:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeZ/xCw+eM1zOye+0TDNAJRu2iGl0D8eo86x0I5EFfn0g/9LVtJTf9XmCyR3AOR1W/P559 X-Received: by 2002:a17:906:c010:: with SMTP id e16mr23619631ejz.214.1622474198949; Mon, 31 May 2021 08:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622474198; cv=none; d=google.com; s=arc-20160816; b=Q+A4So2BFWUmd1vqU0M1r/ni8BgHvp6bFByuvK7VdpUSd0ugsOngbSFg5u+dV8YeSL 7fuY92mMMfqH214zQKcB/TWulpe1FxCmeLtYr8f4ZBhxPSh8enwpLNymH+OCtT3E0WSy EaC6SIXws7KpGS7nFqbSRsmt1NfMM5qUY1gz9AXaeQTjNgo517Q04axm9noC2DTBb/B9 xVth9LVBQy2piaBe9XtmoQ2Ea48cM3b9kn3PTFlVZRynQ/Ie+HZCC07pmu8RABDIYdhe /BYb+bYEC/ZL83Vnf4kcgmj5B72H81P2GVJ1d1CRxtsS71WU5V4ULZZEREu2e/w3sxEZ j/OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tIqF/UrCux6FrPT+4b3XSGZALTyq6+Xbvvd3XUjuduA=; b=JpmCPbkMTss9MtAti0Yzm0y49aSGfRwxXbkQTXJmqVccOC98bdNRnLUeqXv5T+TZKH bj9jH6KizfBshfvET2MPLZ/b/m+z9KyEjae0K6Wm9n1aVSBaeSXUA7j68DiQnk40JAIX DgsoN+G4yOfVpR7IzsXZuPiw2mON0zZJZyZnhw7XIfpVDd/c2DKS3l2AaYvUGsgBugRT eTZsHLQakiLeZ4Z0H7t9LvaWs1Zy0EkQwjQro562V31cTPfzc/UzdmT8ECbsZeXt8IJ1 F42MUOgLRkQRkMWPZGIS1DyCTXgcELjrH1Uy0t2q0T/+mk8jEGjjMKZaGNCkehKEmzzT 4kFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="A/ebyH/A"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o18si13118426edt.176.2021.05.31.08.16.16; Mon, 31 May 2021 08:16:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="A/ebyH/A"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233289AbhEaPRG (ORCPT + 99 others); Mon, 31 May 2021 11:17:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:43312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231994AbhEaONl (ORCPT ); Mon, 31 May 2021 10:13:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3100961477; Mon, 31 May 2021 13:42:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468532; bh=wKNDh19zyfmt6IPmGQrFjb3enLJKJzgwuCm49y5h+Mc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A/ebyH/AS/r4wz6n0aoACXUVwbrlNXsOmVDBLhCl4u9p0fJPH+9jdICMKakS4DWQE +kxBTmMkSm/Y96EIo+IaIBKlxkAcPcC7Zwgd4c+nj/1q+nnl4mOrxfFN7HFaG+Ad8R ufxsqHO96e/HHseqilKd1t3XhH9Xk80CUjPIOQoQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wen Gong , Jouni Malinen , Johannes Berg Subject: [PATCH 5.4 026/177] ath10k: drop fragments with multicast DA for SDIO Date: Mon, 31 May 2021 15:13:03 +0200 Message-Id: <20210531130648.816214067@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wen Gong commit 40e7462dad6f3d06efdb17d26539e61ab6e34db1 upstream. Fragmentation is not used with multicast frames. Discard unexpected fragments with multicast DA. This fixes CVE-2020-26145. Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049 Cc: stable@vger.kernel.org Signed-off-by: Wen Gong Signed-off-by: Jouni Malinen Link: https://lore.kernel.org/r/20210511200110.9ca6ca7945a9.I1e18b514590af17c155bda86699bc3a971a8dcf4@changeid Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/ath10k/htt_rx.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2605,6 +2605,13 @@ static bool ath10k_htt_rx_proc_rx_frag_i rx_desc = (struct htt_hl_rx_desc *)(skb->data + tot_hdr_len); rx_desc_info = __le32_to_cpu(rx_desc->info); + hdr = (struct ieee80211_hdr *)((u8 *)rx_desc + rx_hl->fw_desc.len); + + if (is_multicast_ether_addr(hdr->addr1)) { + /* Discard the fragment with multicast DA */ + goto err; + } + if (!MS(rx_desc_info, HTT_RX_DESC_HL_INFO_ENCRYPTED)) { spin_unlock_bh(&ar->data_lock); return ath10k_htt_rx_proc_rx_ind_hl(htt, &resp->rx_ind_hl, skb, @@ -2612,8 +2619,6 @@ static bool ath10k_htt_rx_proc_rx_frag_i HTT_RX_NON_TKIP_MIC); } - hdr = (struct ieee80211_hdr *)((u8 *)rx_desc + rx_hl->fw_desc.len); - if (ieee80211_has_retry(hdr->frame_control)) goto err;