gve: fix RX page refcount overflow with the pagecnt bias
Status from this message: This series was applied to netdev/net.git (main)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest2 patches 1 replyApplied 2/2
- v52 patches 4 repliesSuperseded
- v42 patches 3 repliesSuperseded
Changes in v6 from the cover letter
- Patch 1: say the check also covers GQI-RDA and why that matters (Sashiko). Message only; carried Joshua's Reviewed-by.
v5: https://lore.kernel.org/netdev/[email protected]/
- Patch 1: check dev->xdp_features instead of queue_format, and reword the subject and message around that (Joshua).
- Patch 2: name INT_MAX in the subject. No code change.
v4: https://lore.kernel.org/netdev/[email protected]/
- Add patch 1/2 blocking XDP on DQO-QPL (Sashiko).
- Say "overflow" instead of "headroom"; use USHRT_MAX directly instead of a macro (Maciej).
- Say which trees need patch 1, for stable.
v3: https://lore.kernel.org/netdev/[email protected]/
v2: https://lore.kernel.org/netdev/[email protected]/
v1: https://lore.kernel.org/netdev/[email protected]/
Patches in v6 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | gve: refuse XDP on queue formats without XDP supportdrivers/ | +6 | 0 replies | Applied |
| 2/2 | gve: fix RX page refcount overflow from INT_MAX pagecnt_biasdrivers/ drivers/ drivers/ +2 more | +12 | 0 replies | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Joshua Washington | Harshitha Ramamurthy | Maciej Fijalkowski |
|---|---|---|---|
| 1/2 | R-b | ||
| 2/2 | R-b T-b | R-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.
Cover letter [PATCH net v6 0/2] gve: fix RX page refcount overflow with the pagecnt bias
gve's GQI and DQO-QPL RX paths bias every RX page's refcount to INT_MAX, so a single get_page() from the stack, e.g. splice() of received data, overflows it: splice/tee fail with EIO/EFAULT and GQI can reset the NIC. Patch 2 lowers the bias to USHRT_MAX, as other drivers do.
With the smaller bias the driver gives up its last reference on a page once every USHRT_MAX handoffs instead of once every INT_MAX, which is only safe while every consumer holds its reference until the buffer is recycled. That is not the case for an XDP_REDIRECT from DQO-QPL to an AF_XDP socket in copy mode, a path the driver never meant to support:
commit d8a8ca14c937 dropped the queue_format check that used to refuse it. Patch 1 refuses XDP on any queue format the driver advertises no XDP features for, today DQO-QPL and GQI-RDA, so patch 2 depends on it. On GQI-RDA it also stops XDP_TX from writing into a TX FIFO that raw addressing never allocates. Trees before 6.17 still have the old check, so there patch 2 stands alone.
v6:
- Patch 1: say the check also covers GQI-RDA and why that matters (Sashiko). Message only; carried Joshua's Reviewed-by.
v5: https://lore.kernel.org/netdev/[email protected]/
- Patch 1: check dev->xdp_features instead of queue_format, and reword the subject and message around that (Joshua).
- Patch 2: name INT_MAX in the subject. No code change.
v4: https://lore.kernel.org/netdev/[email protected]/
- Add patch 1/2 blocking XDP on DQO-QPL (Sashiko).
- Say "overflow" instead of "headroom"; use USHRT_MAX directly instead of a macro (Maciej).
- Say which trees need patch 1, for stable.
v3: https://lore.kernel.org/netdev/[email protected]/
v2: https://lore.kernel.org/netdev/[email protected]/
v1: https://lore.kernel.org/netdev/[email protected]/
Amaan Cheval (2):
gve: refuse XDP on queue formats without XDP support
gve: fix RX page refcount overflow from INT_MAX pagecnt_bias
drivers/net/ethernet/google/gve/gve.h | 2 +- .../net/ethernet/google/gve/gve_buffer_mgmt_dqo.c | 4 ++-- drivers/net/ethernet/google/gve/gve_main.c | 6 ++++++ drivers/net/ethernet/google/gve/gve_rx.c | 8 ++++---- drivers/net/ethernet/google/gve/gve_utils.c | 12 ++++-------- drivers/net/ethernet/google/gve/gve_utils.h | 2 +- 6 files changed, 18 insertions(+), 16 deletions(-)
base-commit: 21f57ec673a1917547c808cfa81890485fffa03b
Signature · 1 line
2.47.3