Thread (7 messages) 7 messages, 3 authors, 2020-09-01

Re: p54: avoid accessing the data mapped to streaming DMA

From: Kalle Valo <hidden>
Date: 2020-09-01 09:34:22
Also in: lkml, netdev

Jia-Ju Bai [off-list ref] wrote:
In p54p_tx(), skb->data is mapped to streaming DMA on line 337:
  mapping = pci_map_single(..., skb->data, ...);

Then skb->data is accessed on line 349:
  desc->device_addr = ((struct p54_hdr *)skb->data)->req_id;

This access may cause data inconsistency between CPU cache and hardware.

To fix this problem, ((struct p54_hdr *)skb->data)->req_id is stored in
a local variable before DMA mapping, and then the driver accesses this
local variable instead of skb->data.

Cc: <redacted>
Signed-off-by: Jia-Ju Bai <redacted>
Acked-by: Christian Lamparter <redacted>
Patch applied to wireless-drivers-next.git, thanks.

478762855b5a p54: avoid accessing the data mapped to streaming DMA

-- 
https://patchwork.kernel.org/patch/11696391/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help