lkml.org 
[lkml]   [2020]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] atm: eni: avoid accessing the data mapped to streaming DMA
From
From: Jia-Ju Bai <baijiaju@tsinghua.edu.cn>
Date: Sun, 2 Aug 2020 17:16:11 +0800

> In do_tx(), skb->data is mapped to streaming DMA on line 1111:
> paddr = dma_map_single(...,skb->data,DMA_TO_DEVICE);
>
> Then skb->data is accessed on line 1153:
> (skb->data[3] & 0xf)
>
> This access may cause data inconsistency between CPU cache and hardware.
>
> To fix this problem, skb->data[3] is assigned to a local variable before
> DMA mapping, and then the driver accesses this local variable instead of
> skb->data[3].
>
> Signed-off-by: Jia-Ju Bai <baijiaju@tsinghua.edu.cn>

Applied.

\
 
 \ /
  Last update: 2020-08-04 00:52    [W:0.051 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site