Skip to content

net: fix stale TX skb pointers on DMA map failure

[email protected] lkml netdev stable 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesApplied 3/3

Patches in v1 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bna: fix use-after-free on DMA mapping failuredrivers/net/ethernet/brocade/bna/bnad.c+1 -10 repliesApplied
2/3hinic3: fix use-after-free on DMA mapping failuredrivers/net/ethernet/huawei/hinic3/hinic3_tx.c+3 -21 replyApplied
3/3net: hibmcge: fix double-free of tx skb on DMA mapping failuredrivers/net/ethernet/hisilicon/hibmcge/hbg_txrx.c+1 -01 replyApplied

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJijie ShaoSimon HormanFan Gong
SeriesR-b
1/3
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH net v1 0/3] net: fix stale TX skb pointers on DMA map failure

From: Xuanqiang Luo <[email protected]>

While I was backporting commit 1a303baa715e6 ("ice: fix double-free of tx_buf skb"), an AI-assisted scan identified several suspected TX error paths. I reviewed the results and found this issue in the three drivers fixed here.

The drivers differ, but the bug is the same. On a DMA mapping failure, the TX path frees an skb while its ring entry still points to it. A later transmission normally overwrites the entry. If the interface is stopped first, teardown can instead access or free the skb again.

I do not have these adapters, so I have not tested the drivers on hardware. I checked the error and teardown paths by inspection. Still, these small fixes seem worth posting for review. They are independent, but are sent as one series because they address the same issue.

Xuanqiang Luo (3):
bna: fix use-after-free on DMA mapping failure
hinic3: fix use-after-free on DMA mapping failure
net: hibmcge: fix double-free of tx skb on DMA mapping failure

 drivers/net/ethernet/brocade/bna/bnad.c           | 2 +-
 drivers/net/ethernet/hisilicon/hibmcge/hbg_txrx.c | 1 +
 drivers/net/ethernet/huawei/hinic3/hinic3_tx.c    | 5 +++--
 3 files changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
2.43.0