From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jianlin Shi <shijianlin11@foxmail.com>
Cc: netdev@vger.kernel.org, virtualization@lists.linux.dev,
jasowang@redhat.com, eperezma@redhat.com,
xuanzhuo@linux.alibaba.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, talgi@nvidia.com, hengqi@linux.alibaba.com,
horms@kernel.org
Subject: Re: [PATCH v2 0/2] virtio-net/dim: fix irq moderation init failure unwind
Date: Thu, 19 Nov 2026 09:45:33 -0500 [thread overview]
Message-ID: <20261119094456-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20261102155145.23144-1-shijianlin11@foxmail.com>
On Mon, Nov 02, 2026 at 11:51:43PM +0800, Jianlin Shi wrote:
> 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.
this is not how u submit a patch to netdev:
1. start a new thread
2. put "net" in the prefix as in [PATCH net 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/cover.1790751008.git.shijianlin11@foxmail.com/
>
> 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(-)
>
> Signed-off-by: Jianlin Shi <shijianlin11@foxmail.com>
>
> --
> 2.43.0
prev parent reply other threads:[~2026-11-19 14:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 8:19 [PATCH 0/2] virtio-net/dim: fix irq moderation init failure unwind Jianlin Shi
2026-09-30 8:19 ` [PATCH 1/2] dim: clear irq_moder on init failure Jianlin Shi
2026-09-30 8:33 ` sashiko-bot
2026-10-06 1:53 ` Jakub Kicinski
2026-10-08 15:42 ` Jianlin Shi
2026-09-30 8:19 ` [PATCH 2/2] virtio-net: unwind VQs when irq moderation init fails Jianlin Shi
2026-09-30 8:33 ` sashiko-bot
2026-11-02 13:46 ` Michael S. Tsirkin
2026-11-02 15:51 ` [PATCH v2 0/2] virtio-net/dim: fix irq moderation init failure unwind Jianlin Shi
2026-11-02 15:51 ` [PATCH v2 1/2] dim: clear irq_moder on init failure Jianlin Shi
2026-11-02 15:51 ` [PATCH v2 2/2] virtio-net: unwind VQs when irq moderation init fails Jianlin Shi
2026-11-19 14:45 ` Michael S. Tsirkin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261119094456-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=eperezma@redhat.com \
--cc=hengqi@linux.alibaba.com \
--cc=horms@kernel.org \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shijianlin11@foxmail.com \
--cc=talgi@nvidia.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox