Re: [PATCH net-next 3/3] net: devmem: decode DMA addresses for TX

From
Mina Almasry <hidden>
Date
2026-09-24 19:26:57
Also in
io-uring, lkml
Reply to
Stanislav Fomichev, 2026-09-22
On Tue, Sep 22, 2026 at 1:43 PM Stanislav Fomichev [off-list ref] wrote:
On 32-bit architectures where dma_addr_t is wider than unsigned long,
page_pool_set_dma_addr_netmem() stores page-aligned DMA addresses shifted
by PAGE_SHIFT. The net_iov branch of __skb_frag_dma_map() adds byte offsets
to the encoded value, so the NIC is programmed with an invalid DMA address.
This can trigger an IOMMU fault or DMA from unintended memory.

Consolidate DMA address encoding, decoding, and representability checks in
netmem helpers. Use the common decoder from the page pool and net_iov TX
paths so both interpret stored addresses consistently.

Fixes: bd61848900bf ("net: devmem: Implement TX path")
Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Mina Almasry <redacted>

-- 
Thanks,
Mina
Thread (20 messages) 20 messages, 4 authors, last reply 2026-09-27
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help