Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2688024pxj; Mon, 31 May 2021 08:16:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAB4RHnAr4bDSMkBBjulKtfbvQiHMN/u4pwzg5+yX6P+Ei2Txll8I/ZmiOAFS/icWBTsIm X-Received: by 2002:a02:7348:: with SMTP id a8mr21014299jae.116.1622474215210; Mon, 31 May 2021 08:16:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622474215; cv=none; d=google.com; s=arc-20160816; b=CVuiFpX+bOpqX2pL8oARcq+PzUaFxifZGrNuTmWPOelGg4DXoyQG+TPt3YYKcrT4jC UrqumBgAh3hDmqGcM9SeNMVSRQzM60jzil/XQH3Z2rVHvv+W2MZ/SaSDDU6GtFSebKU5 TpZLcPV9SVHbgxZokLMjdGqX/5KRvW3B/p7Jj972N3rfFfmMjONEPm4yAUPRaekhXKde ZGYftY8qbhAOZMONcF9tJTJTFQfd8+1f94kD4NcilmWk+5YXjfrV1ckXy6dYyZFo3r7X QSESx5qvdQyX0JaOMY4lNevpCC0fJpnzZLjhDpOIigVyxZFgVqlqFbGNHhaD8l8VQGo+ wlZA== 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=umSbKcwYpSDDBg2BievwhC7bTPWhvwN2RR0TSRjxGtU=; b=peo9LMlrG3IPaK4CSeMEZaJnuZFu1TP9f0XttB+V+YVZw3cvKR4uQUt05gMJpxEhW/ fZyE7WObs2d7kDMrFmPm31PPsyyxitz5gOKMGYzLosWrmEt8boedzNchKyQvI9dvYa/e ifONtPX1PsURslg2C0YXrw69U7mFPOis/ZD+0vIJOuIWDO91QbqPbzwkKdvjnU6TM5Q8 P5X/lGA8rx4S8EKr+FFxnVsAYfqUoU7YMV4c7O71qSUgfE9SWpflWeyMnGID3VYIdAgO Pj6I7kwSPZTaka7P5JC1xGNU8FI8KPyzsgAxOPfjMsaBaLjZuCl9YAhCN4Wl/v6VQkUO 9SPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0ugsoNCu; 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 x6si10764445ilv.67.2021.05.31.08.16.41; Mon, 31 May 2021 08:16:55 -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=0ugsoNCu; 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 S233564AbhEaPRj (ORCPT + 99 others); Mon, 31 May 2021 11:17:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:43520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233085AbhEaONz (ORCPT ); Mon, 31 May 2021 10:13:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 83D3F61993; Mon, 31 May 2021 13:42:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468535; bh=ogvrseXvgYKLRlvYzFdf37ht/NnFT3HuLCRJOz8saRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0ugsoNCuUSeqen39oz0+xi6XmngAeCdDsIpk+I/g4BopmpNbDUqr/HDCTC87Q4D6Y KDe2g9IMLBwk6oITQh9D0+hJ22V+g4tKeIG8DT3xHxYKq9DDASHKbY/TkvfboQvsce iiEUZ+cxTDGvXd5LL3QcwxO1WKW69uTfQeUQsQys= 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 027/177] ath10k: drop MPDU which has discard flag set by firmware for SDIO Date: Mon, 31 May 2021 15:13:04 +0200 Message-Id: <20210531130648.856636173@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 079a108feba474b4b32bd3471db03e11f2f83b81 upstream. When the discard flag is set by the firmware for an MPDU, it should be dropped. This allows a mitigation for CVE-2020-24588 to be implemented in the firmware. 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.11968c725b5c.Idd166365ebea2771c0c0a38c78b5060750f90e17@changeid Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/ath10k/htt_rx.c | 5 +++++ drivers/net/wireless/ath/ath10k/rx_desc.h | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2305,6 +2305,11 @@ static bool ath10k_htt_rx_proc_rx_ind_hl fw_desc = &rx->fw_desc; rx_desc_len = fw_desc->len; + if (fw_desc->u.bits.discard) { + ath10k_dbg(ar, ATH10K_DBG_HTT, "htt discard mpdu\n"); + goto err; + } + /* I have not yet seen any case where num_mpdu_ranges > 1. * qcacld does not seem handle that case either, so we introduce the * same limitiation here as well. --- a/drivers/net/wireless/ath/ath10k/rx_desc.h +++ b/drivers/net/wireless/ath/ath10k/rx_desc.h @@ -1282,7 +1282,19 @@ struct fw_rx_desc_base { #define FW_RX_DESC_UDP (1 << 6) struct fw_rx_desc_hl { - u8 info0; + union { + struct { + u8 discard:1, + forward:1, + any_err:1, + dup_err:1, + reserved:1, + inspect:1, + extension:2; + } bits; + u8 info0; + } u; + u8 version; u8 len; u8 flags;