Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2721912pxj; Mon, 31 May 2021 09:06:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+ZtHedT5OtrisPRbiZC3a0zDRjSR9ooM6tLr6XQCu4PpzePvbeiQ1vBhQ8PEu2+ZzaLp3 X-Received: by 2002:a02:c04c:: with SMTP id u12mr21120697jam.129.1622477165119; Mon, 31 May 2021 09:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622477165; cv=none; d=google.com; s=arc-20160816; b=JUMaGDOf/PZIC+gcNqvwZ8EmfHEMezhPTHjkD7vYgU8TJmkR7hcSPDP/3m6DJNkKpS gjlJ68WTooP35NnpS+sOjsWZAplJQcljmAJMbMPiSgaL2slx1QVmapp2JJREBRwDe6p8 SNvauo5IqLiaJGSdjiEKdbhz6XZNU/jIsunS2+x9kSWSPPZQzREdP85B4BA5NR/4+dCu Xpm1UAfeCriAAkFYdotV7zxx48V+Ea6Bwfse/feHeNjtoHDffMak5weqQpmcoBtqGkOS Z7mY8tLJaGIBshNqod/lDvkwKLKUKAD370/zzxwP1I5ZrRvIElNtCx0rNhxDnxvB3VQm VDXA== 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=8xGhDpy/uHiggVale8wJzCyY+zTdK2b2QampiRWPNLA=; b=Sc8/nLmFEcCLeH5T7CwkRtYf8eke0kseW99IBVbOurim4Rm5lcYWC7J2j2movlj0CV BZeILUy8dEbycD25zE57LxOvN9kYDXzgcnGHn4E/q27Z7RYVh/5LhQupaRCv7qF2KR2K +8OxxoNIDHE/cCd5FTb5ZrXxqbzfTdx+1ztM5NCoa7u09u9VWIMTJIQPYJZJDtEFxvPD kbiS51g7GQ1UoOlYrWy75Uq4w+ZdGxVTdP4rlnCcj+BM2dgCSgfglbWxpj9t+6Jk4dDh fxAnja2phNb0us8AQMQEoeaGTnLBn5CB6ia4CVCNuXCGfMLgYNFasGFKoWKNhTddrMb5 /row== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aX+Y3rCZ; 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 w13si6246201jao.90.2021.05.31.09.05.51; Mon, 31 May 2021 09:06:05 -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=aX+Y3rCZ; 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 S232597AbhEaQFm (ORCPT + 99 others); Mon, 31 May 2021 12:05:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:33112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231801AbhEaOf3 (ORCPT ); Mon, 31 May 2021 10:35:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 916E961431; Mon, 31 May 2021 13:50:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469050; bh=jjaXlbtyJiRj1P+l5mUfsCFqIybcq8PmYGxgHVVNIvM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aX+Y3rCZSOgOyj0klXYKOSBpeXgZEafcp9oG4M29jlu/nFVqys40ppxlAntFyQmNr bR+vdC9HTSgQD1NSEOXkCXX79w4Bw66Q/nj0FDTdYsGFh6MebQSGkIWJVTIXmB/YX5 GFIymveM7BrdaAeIRxCZous6hEaTJhQo+xJf65Gc= 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.12 049/296] ath10k: Fix TKIP Michael MIC verification for PCIe Date: Mon, 31 May 2021 15:11:44 +0200 Message-Id: <20210531130705.480482471@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@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 0dc267b13f3a7e8424a898815dd357211b737330 upstream. TKIP Michael MIC was not verified properly for PCIe cases since the validation steps in ieee80211_rx_h_michael_mic_verify() in mac80211 did not get fully executed due to unexpected flag values in ieee80211_rx_status. Fix this by setting the flags property to meet mac80211 expectations for performing Michael MIC validation there. This fixes CVE-2020-26141. It does the same as ath10k_htt_rx_proc_rx_ind_hl() for SDIO which passed MIC verification case. This applies only to QCA6174/QCA9377 PCIe. Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1 Cc: stable@vger.kernel.org Signed-off-by: Wen Gong Signed-off-by: Jouni Malinen Link: https://lore.kernel.org/r/20210511200110.c3f1d42c6746.I795593fcaae941c471425b8c7d5f7bb185d29142@changeid Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/ath10k/htt_rx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -1974,6 +1974,11 @@ static void ath10k_htt_rx_h_mpdu(struct } ath10k_htt_rx_h_csum_offload(msdu); + + if (frag && !fill_crypt_header && + enctype == HTT_RX_MPDU_ENCRYPT_TKIP_WPA) + status->flag &= ~RX_FLAG_MMIC_STRIPPED; + ath10k_htt_rx_h_undecap(ar, msdu, status, first_hdr, enctype, is_decrypted); @@ -1991,6 +1996,11 @@ static void ath10k_htt_rx_h_mpdu(struct hdr = (void *)msdu->data; hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_PROTECTED); + + if (frag && !fill_crypt_header && + enctype == HTT_RX_MPDU_ENCRYPT_TKIP_WPA) + status->flag &= ~RX_FLAG_IV_STRIPPED & + ~RX_FLAG_MMIC_STRIPPED; } }