From: Joshua Klinesmith <joshuaklinesmith@gmail.com>
To: nbd@nbd.name, lorenzo@kernel.org, ryder.lee@mediatek.com
Cc: shayne.chen@mediatek.com, sean.wang@mediatek.com,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Joshua Klinesmith <joshuaklinesmith@gmail.com>,
stable@vger.kernel.org
Subject: [PATCH 1/3] wifi: mt76: mt7615: fix DMA read beyond mapped length
Date: Mon, 6 Apr 2026 14:45:54 -0400 [thread overview]
Message-ID: <20260406184556.8245-2-joshuaklinesmith@gmail.com> (raw)
In-Reply-To: <20260406184556.8245-1-joshuaklinesmith@gmail.com>
tx_prepare_skb() overrides buf[1].len to MT_CT_PARSE_LEN (72)
for firmware header parsing, but dma_map_single() only maps
skb_headlen(skb) bytes. When the SKB is shorter than 72 bytes,
the hardware reads past the DMA-mapped region, causing SMMU
translation faults on IOMMU-enabled systems.
Cap the firmware parse length to the actual DMA-mapped length.
Fixes: e90354e0452d ("mt76: mt7615: move core shared code in mt7615-common module")
Cc: stable@vger.kernel.org
Signed-off-by: Joshua Klinesmith <joshuaklinesmith@gmail.com>
---
drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c
index 53cb1eed1e4f..dc7128c46a72 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c
@@ -35,7 +35,7 @@ mt7615_write_fw_txp(struct mt7615_dev *dev, struct mt76_tx_info *tx_info,
/* pass partial skb header to fw */
tx_info->buf[0].len = MT_TXD_SIZE + sizeof(*txp);
- tx_info->buf[1].len = MT_CT_PARSE_LEN;
+ tx_info->buf[1].len = min_t(u32, MT_CT_PARSE_LEN, tx_info->buf[1].len);
tx_info->buf[1].skip_unmap = true;
tx_info->nbuf = MT_CT_DMA_BUF_NUM;
--
2.43.0
next prev parent reply other threads:[~2026-04-06 18:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-06 18:45 [PATCH 0/3] wifi: mt76: fix DMA read beyond mapped length Joshua Klinesmith
2026-04-06 18:45 ` Joshua Klinesmith [this message]
2026-04-06 18:45 ` [PATCH 2/3] wifi: mt76: mt7915: " Joshua Klinesmith
2026-04-06 18:45 ` [PATCH 3/3] wifi: mt76: mt7996: " Joshua Klinesmith
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=20260406184556.8245-2-joshuaklinesmith@gmail.com \
--to=joshuaklinesmith@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=ryder.lee@mediatek.com \
--cc=sean.wang@mediatek.com \
--cc=shayne.chen@mediatek.com \
--cc=stable@vger.kernel.org \
/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