From: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
To: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org,
vaibhavgupta40@gmail.com, christophe.jaillet@wanadoo.fr,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtl8180: avoid accessing the data mapped to streaming DMA
Date: Tue, 20 Oct 2020 00:47:01 +0200 [thread overview]
Message-ID: <fae50154-9736-56fb-11f2-b9975d7a1bb4@maciej.szmigiero.name> (raw)
In-Reply-To: <20201019025420.3789-1-baijiaju1990@gmail.com>
On 19.10.2020 04:54, Jia-Ju Bai wrote:
> In rtl8180_tx(), skb->data is mapped to streaming DMA on line 476:
> mapping = dma_map_single(..., skb->data, ...);
>
> On line 459, skb->data is assigned to hdr after cast:
> struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
>
> Then hdr->seq_ctrl is accessed on lines 540 and 541:
> hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
> hdr->seq_ctrl |= cpu_to_le16(priv->seqno);
>
> These DMA accesses may cause data inconsistency between CPU and hardwre.
>
> To fix this problem, hdr->seq_ctrl is accessed before the DMA mapping.
>
This looks like a bug fix to me, shouldn't this have a Fixes: tag and
be CC'ed to stable@?
Maciej
prev parent reply other threads:[~2020-10-19 23:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 2:54 [PATCH] rtl8180: avoid accessing the data mapped to streaming DMA Jia-Ju Bai
2020-10-19 18:43 ` Jakub Kicinski
2020-10-19 22:47 ` Maciej S. Szmigiero [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fae50154-9736-56fb-11f2-b9975d7a1bb4@maciej.szmigiero.name \
--to=mail@maciej.szmigiero.name \
--cc=baijiaju1990@gmail.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vaibhavgupta40@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).