Skip to content

eth: fbnic: harden Rx and Tx completion handling

Yehyeong Lee lkml netdev stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest5 patches 7 repliesIn review

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5eth: fbnic: only act on Rx completions naming a posted bufferdrivers/net/ethernet/meta/fbnic/fbnic_txrx.c+82 -52 replies
2/5eth: fbnic: validate the Rx completion offset and lengthdrivers/net/ethernet/meta/fbnic/fbnic_txrx.c+38 -31 reply
3/5eth: fbnic: return a pending Rx packet before reusing its bufferdrivers/net/ethernet/meta/fbnic/fbnic_txrx.c+33 -291 reply
4/5eth: fbnic: return the page reference taken for a dropped Rx fragmentdrivers/net/ethernet/meta/fbnic/fbnic_txrx.c+2 -01 reply
5/5eth: fbnic: bound the XDP Tx completion head to the ringdrivers/net/ethernet/meta/fbnic/fbnic_txrx.c+6 -01 reply

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH net v3 0/5] eth: fbnic: harden Rx and Tx completion handling

The Rx and Tx completion descriptors carry buffer ids, offsets and lengths that the device writes and the driver consumes without validating. v2 bounded the Rx buffer index against the array only, which the review found insufficient: an in-range id naming an unposted slot still reaches a NULL page, a bare META completion still builds an skb from a NULL buffer, and the offset, length and the Tx completion head are not checked at all.

This series validates each of these against what was actually posted and takes the existing drop path, and bounds the XDP Tx completion loop so a head outside the ring cannot spin it.

Patch 1 validates the Rx buffer id at every use and drops a bare META completion. Patch 2 validates the offset and length. Patch 3 returns a pending packet before a new header reuses its slot. Patch 4 is unchanged from v2 and returns the page reference for a dropped fragment. Patch 5 bounds the Tx completion head.

v2: https://lore.kernel.org/netdev/[email protected]/

Yehyeong Lee (5):
eth: fbnic: only act on Rx completions naming a posted buffer
eth: fbnic: validate the Rx completion offset and length
eth: fbnic: return a pending Rx packet before reusing its buffer
eth: fbnic: return the page reference taken for a dropped Rx fragment
eth: fbnic: bound the XDP Tx completion head to the ring

 drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 192 +++++++++++++++----
 1 file changed, 158 insertions(+), 34 deletions(-)
Signature · 1 line
2.43.0