Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1931858pxb; Sat, 7 Nov 2020 03:45:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfliZbfZ0UHMdIhsqJDcZTJX2zjnkXLaqsOte/45nQWFDlEXXnf7x/EQP+218EPCNRBAkr X-Received: by 2002:a50:85c6:: with SMTP id q6mr6766230edh.126.1604749558361; Sat, 07 Nov 2020 03:45:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604749558; cv=none; d=google.com; s=arc-20160816; b=BcSful+idf5etmYxfMHplmqiq1v/uwPe7rzQrP76WNO7lvEaDuniE2Z6OuRVCjz/5t 1UJuIc5cnAKJvY1Cfp/TRK+t0fvf2kYGut6bag1akGF+8MbMbWuqUnaHP9p6Cf4+ZX6S rOPBRuYsM/hnJc9DurP4NYiBdP4ji6IKe1OPMVJmZsk93AVrUTfc9XBty7i3lt1NUBdS ehfm5cFoFnab3GIdeOJHbKt+QHa3Z6T2E32kI6Mi4jcZMEutvI1TusW4tP2rLWOBBp4Z k1M3xPwqkenHvA6F/aJdb/yiqRuuCxYWcrhj1uqcnqmwFDgJ2ePFDiPT17vo6vPk6tbx lnVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:user-agent:cc:to:references :in-reply-to:from:subject:content-transfer-encoding:mime-version :dmarc-filter:sender:dkim-signature; bh=KfrqDO+sqQbyMbQAzatoYRHDEZ40eLbmXaDe9WdEpBQ=; b=djJzY6OM7ix1l/YZRUD5DTw0kjYv92HI/yQ6rkRV2/hRaFNt5G0nTGCg84VeU23kbm 3F0qrPRJXeaHA8J7ZemYhXL7zEfr9dDm55bDp+orbE2BASbM3D7vETMXCOAi5j/lVN+W +WqWOz6lJ4o/CEBxHrH/hKxu1k8GCgVIL+SB3MHECJ+wKhZr78r19eyeN7CGe7/uhXKC yeUpsFXdwbzA5/r6Ikp3ZEhV0XHHTZAjLG3NpqKEZCC0Ng6xlMe6M7nRjHWMG6q8KBkh b5gqBomAnDmRGTdyKaUbFUyQh3pn9qWBmQaZzdLHj+y9T/9gaJjcjOFCk54+NF0+Kot5 MekA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=BCf82n2n; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t16si2861480ejb.494.2020.11.07.03.45.32; Sat, 07 Nov 2020 03:45:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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=@mg.codeaurora.org header.s=smtp header.b=BCf82n2n; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727873AbgKGLob (ORCPT + 99 others); Sat, 7 Nov 2020 06:44:31 -0500 Received: from m42-4.mailgun.net ([69.72.42.4]:63006 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727298AbgKGLoa (ORCPT ); Sat, 7 Nov 2020 06:44:30 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1604749469; h=Date: Message-Id: Cc: To: References: In-Reply-To: From: Subject: Content-Transfer-Encoding: MIME-Version: Content-Type: Sender; bh=KfrqDO+sqQbyMbQAzatoYRHDEZ40eLbmXaDe9WdEpBQ=; b=BCf82n2nI/YxqnSUa9T3MLockUx/4/BQYjdUcH6Jz3oRkY6R5fask2vKDxyIf1I4yw8A2BVN TAi2/Ez+CaiPI1FjmyHCeYVsEOdxjE1xhaYYGu6sayiFuCVlQzMtow+fDACxRwPeB5uxSvmA CTs7sZ69EUouHRzTelU+lt7XBis= X-Mailgun-Sending-Ip: 69.72.42.4 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-west-2.postgun.com with SMTP id 5fa6888c1d3980f7d667df5d (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sat, 07 Nov 2020 11:44:12 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 87F8EC43382; Sat, 7 Nov 2020 11:44:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,BAYES_00, MISSING_DATE,MISSING_MID,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 88C16C433C6; Sat, 7 Nov 2020 11:44:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 88C16C433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=kvalo@codeaurora.org Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] rtl8192ce: avoid accessing the data mapped to streaming DMA From: Kalle Valo In-Reply-To: <20201019030931.4796-1-baijiaju1990@gmail.com> References: <20201019030931.4796-1-baijiaju1990@gmail.com> To: Jia-Ju Bai Cc: pkshih@realtek.com, davem@davemloft.net, kuba@kernel.org, straube.linux@gmail.com, Larry.Finger@lwfinger.net, christophe.jaillet@wanadoo.fr, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai User-Agent: pwcli/0.1.0-git (https://github.com/kvalo/pwcli/) Python/3.5.2 Message-Id: <20201107114412.87F8EC43382@smtp.codeaurora.org> Date: Sat, 7 Nov 2020 11:44:12 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Jia-Ju Bai wrote: > In rtl92ce_tx_fill_cmddesc(), skb->data is mapped to streaming DMA on > line 530: > dma_addr_t mapping = dma_map_single(..., skb->data, ...); > > On line 533, skb->data is assigned to hdr after cast: > struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); > > Then hdr->frame_control is accessed on line 534: > __le16 fc = hdr->frame_control; > > This DMA access may cause data inconsistency between CPU and hardwre. > > To fix this bug, hdr->frame_control is accessed before the DMA mapping. > > Signed-off-by: Jia-Ju Bai Like Ping said, use "rtlwifi:" prefix and have all rtlwifi patches in the same patchset. 4 patches set to Changes Requested. 11843533 rtl8192ce: avoid accessing the data mapped to streaming DMA 11843541 rtl8192de: avoid accessing the data mapped to streaming DMA 11843553 rtl8723ae: avoid accessing the data mapped to streaming DMA 11843557 rtl8188ee: avoid accessing the data mapped to streaming DMA -- https://patchwork.kernel.org/project/linux-wireless/patch/20201019030931.4796-1-baijiaju1990@gmail.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches