Skip to content

wifi: mt76: fix DMA read beyond mapped length

Joshua Klinesmith linux-wireless lkml stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3wifi: mt76: mt7615: fix DMA read beyond mapped lengthdrivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c+1 -10 replies
2/3wifi: mt76: mt7915: fix DMA read beyond mapped lengthdrivers/net/wireless/mediatek/mt76/mt7915/mac.c+1 -10 replies
3/3wifi: mt76: mt7996: fix DMA read beyond mapped lengthdrivers/net/wireless/mediatek/mt76/mt7996/mac.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] wifi: mt76: fix DMA read beyond mapped length

tx_prepare_skb() in mt7615, mt7915, and mt7996 overrides buf[1].len to MT_CT_PARSE_LEN (72 bytes) for firmware header parsing, but dma_map_single() in dma.c only maps skb_headlen(skb) bytes. When the SKB is shorter than 72 bytes (e.g. a 54-byte TCP SYN), the DMA descriptor tells the hardware to read past the mapped region.

On systems without IOMMU this is silently ignored. On systems with SMMU (e.g. NXP LS1028A), the read past the page boundary triggers an SMMU translation fault.

Cap buf[1].len to min(MT_CT_PARSE_LEN, original_mapped_len) in all three drivers.

Joshua Klinesmith (3):
wifi: mt76: mt7615: fix DMA read beyond mapped length
wifi: mt76: mt7915: fix DMA read beyond mapped length
wifi: mt76: mt7996: fix DMA read beyond mapped length

 drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c | 2 +-
 drivers/net/wireless/mediatek/mt76/mt7915/mac.c     | 2 +-
 drivers/net/wireless/mediatek/mt76/mt7996/mac.c     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)