Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2688440pxj; Mon, 31 May 2021 08:17:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7vB1lE3qOGC4GVNf7v5xZ/db9h6foUfzniebstbnyCAKzSAUTJl4QBW8RdBFH1KUBuMql X-Received: by 2002:a92:6b05:: with SMTP id g5mr17590802ilc.40.1622474244971; Mon, 31 May 2021 08:17:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622474244; cv=none; d=google.com; s=arc-20160816; b=qO1Ts0XTIhKMkvvreDiOIsNolMN6s2OscwUQne8DyOALU6L8H6ChoXiS1r+LNDpwee B6cxsK0uddkOY/KTFtT/EL6U451itlnzeE/TnpSW5GrtlIz4iKks1JT8oQ+Cf6cL01Yy gcs1YzSzKLvQsGw/E7OgcW7QOlkd+xtDrrbZ21ywXxUGcyXEqIrUrUccTE0y2L/OnrDY ZH8wCSBBgPxzjFczhN8DRKrHxtcXvyYVAzN+JoUN6/6Unr5jhXFrNm/4IO1Z0JMKekEQ 6Jl/gmF9QJSLUdYY4hrwg/MLvg6v+A0hhEffqTUVl2TzCm/NglZ+KhozHIh4awtpYDb4 bx2A== 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=RafMRkytyVz53lvLJVB5gXmuU1O+Lf9gWbjFtx99FT0=; b=e6zO8+feeIFpJYz5yxlzumpwlpEMFzKqplFHBri9wYgPeicZugSsc66wwJN4LCDVeb NPkjtV3mVhZSyiBxCU8QYhbqh880kC4+nU/V+o+p/zd11HWWPzS0uiFIYCxJkR6yC9kb Ewi/5YdU+JzWuscB7dkz5LxzX6yJrB+Z/Sm84ulpU5aiff+5TZ2rpAVMz9sI/XM/Un/v cvSSLnQ58vAHYCk21IbGqSRIEZYGbb/eUjcyJpxA415t6XE+zPOqQzyXNIjs3w6PUb8q qKsGbj1eD+QJ5IisqToSJcDrdiyIFEmOjUO9FtDw0e/mXHohmcSTxUy3gyaXF5VOzvE9 vaYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tdIOtdty; 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 i6si14549909ilj.74.2021.05.31.08.17.11; Mon, 31 May 2021 08:17:24 -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=tdIOtdty; 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 S232724AbhEaPSS (ORCPT + 99 others); Mon, 31 May 2021 11:18:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:43708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233536AbhEaOOJ (ORCPT ); Mon, 31 May 2021 10:14:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F3A661465; Mon, 31 May 2021 13:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468540; bh=4eTbK71wXiAy9iR8F5TQTcOGUOabaygBHcmgKZtBN4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tdIOtdty9K1FxoNG3cHkAizg9HGktUerDhybfNp2C5ar0FwazJNovFoxwlsB3GWHK EtCMfcpqYjlZcHoMHQVlXclNVPDGoRSTwXSrfU8jkJHKIKm89E1M4DNua2UfRLNw8d MvSE4XUprbb+kSQiBIvjkJ32AQHzW2Rv+GoTuJqM= 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 028/177] ath10k: Fix TKIP Michael MIC verification for PCIe Date: Mon, 31 May 2021 15:13:05 +0200 Message-Id: <20210531130648.887525257@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 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 @@ -1967,6 +1967,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); @@ -1984,6 +1989,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; } }