virtio-net/dim: fix irq moderation init failure unwind
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 1 replyIn review
- v22 patches 3 repliesSuperseded
- v12 patches 3 repliesSuperseded
Changes in v3 from the cover letter
- Resend as a new thread with a [PATCH net] subject prefix, as requested by Michael S. Tsirkin.
- No functional changes. Both patches are identical to v2.
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | dim: clear irq_moder on init failurelib/ | +1 | 0 replies | |
| 2/2 | virtio-net: unwind VQs when irq moderation init failsdrivers/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH net v3 0/2] virtio-net/dim: fix irq moderation init failure unwind
net_dim_init_irq_moder() leaves dev->irq_moder dangling when profile allocation fails. virtio-net probe then skips the virtqueue teardown if that init fails after init_vqs(), leaking the virtqueues and their DMA mappings.
Patch 1 makes the dim init failure path clear dev->irq_moder, so net_dim_free_irq_moder() is a no-op afterwards. Patch 2 sends the virtio-net failure through the existing free_irq_moder unwind (reset + del_vqs), matching the page-pool failure path. Patch 2 depends on patch 1.
Changes since v2:
- Resend as a new thread with a [PATCH net] subject prefix, as requested by Michael S. Tsirkin.
- No functional changes. Both patches are identical to v2.
Changes since v1 [1]:
- Patch 1's commit message now documents the call sequence the maintainer asked for: on current mainline the dangling pointer is never dereferenced by the only in-tree caller (virtio-net probe does "goto free", which only reaches free_netdev()). It becomes reachable once the caller unwinds through free_irq_moder as patch 2 does, which makes patch 1 a hard prerequisite rather than a standalone bug fix.
- No functional changes; both patches are identical to v1.
[1] https://lore.kernel.org/netdev/[email protected]/
Jianlin Shi (2):
dim: clear irq_moder on init failure
virtio-net: unwind VQs when irq moderation init fails
drivers/net/virtio_net.c | 2 +- lib/dim/net_dim.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.43.0