🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20371

[PATCH net v3 0/2] virtio-net/dim: fix irq moderation init failure unwind

#20371
From: Jianlin Shi
Date: Sun, 22 Nov 2026 09:05
44 lines
10781 bytes
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/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
Technical Details
Message-ID: <20261122090557.19766-1-shijianlin11@foxmail.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368616-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368616-linux-kernel-netdev=dewy.ru
From: shijianlin11@foxmail.com (Jianlin Shi)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v3 0/2] virtio-net/dim: fix irq moderation init failure unwind
Date: Sun, 22 Nov 2026 17:05:55 +0800
Organization: Usenet Network
Message-ID: <20261122090557.19766-1-shijianlin11@foxmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3602848"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Qzl60z29udG7Ewq5EIo8HJ9l/Eo= sha256:keSvvQOLqxnepGMXsXLw/5Ii4hF/B75+wygvXfOAADw=
	sha1:GLmZc6KNctxLZRA2XuD5pEa7WxI= sha256:kKlSqWf8bWTI4YhHSmK3l4XlG4S8jxV9HngRTf3TyBY=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id BD44C125D72; Sun, 22 Nov 2026 12:06:25 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: 0.609
X-Spam-Status: No, score=0.609 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_SBL_CSS=3.558,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=no autolearn_force=no
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id H9YuD2LlrNld;
	Sun, 22 Nov 2026 12:06:21 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-368616-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=foxmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 67F39125D71; Sun, 22 Nov 2026 12:06:16 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 1CC902EAD1; Sun, 22 Nov 2026 09:06:15 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795338374;
	b=cGjZrjHRoD6mxWqzlH49Re7pDKuaUe2HC88ap5m+DQUyy2buxBOT5XccqXYnZkRUj3os
	 89Dx9hID1ZJ37wVG8dOGsF7srqT1RI95bbQYKierg0/km3exmrF8upQHSc0BDsmHpY/6R
	 FJ7gHEZ7nFJ1PWcRRuQk6UE+QF5g1KLZKKqig98QiK+xCyIjvQA9bm5yK4JMr7Repw7xj
	 XSD/XNzwiD+bwaAqj5Ag45yWhbYY3gFadm36FZVGdFSe8Wh08r2u/t8L9Txhv7w8qxKiN
	 h+H/g8Ls+p9QwOCEmMHBuUuXEjpAUTannFPQ5kZ7x/YqYXpGhWBAaT2IH4VwApGkwcg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795338374;
	h=X-Original-To:Received:DMARC-Filter:Received:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=8vOXTOFvnrcmfNX9TrDkyysz8FDRPCViCUHoqkPWXYc=;
	b=utgch77moNqwhnikuv5JeEuZ9r6b6Ccqv4nwk0VS2Wa6bUJQTZh819iI2L5aMLvHPRHs
	 NO8TjgGVBBTsjB+0IYGIFniPGcPS1i/k2u/2HrJnkQCB7qjAIQcmY1+hZKjRo9JUOlVIM
	 qCuoA0wWibL27rj08SqKKrdRHDgIIK755s7zoCGaUhTROA/9dLACqYz3dM6KvpS+4OALW
	 MTXwAFRUtOnEdnTs4J8zyLQ62eP0IvSqilxh7R9uPHUrmx9NhWpGhB5jX+TNLjjPqc3EB
	 d5RoSreZ5K0Wiqzit8+187HLMx49ur62dAUdIwTjdPM9RZsQN3qJVCQlUUAyhb1d35w==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=fail header.from=foxmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id DB094606A333;
	Sun, 22 Nov 2026 09:06:14 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.229.131
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795338374;
	b=0Zh7bTewzj06JrZiYWJ5eFklKvpyqjMcMZsHLnuvMYS7ZFL6B4vLVyLC6N51MvwoQ4VC
	 Z+lrVNBnJA6Ww75Oxtwa/NqauLJwnVUmS5SvcZJDA0QtNCV2d2W/Lsd/MFN/uFRlO2Ius
	 8AqPai+6nWj4r9aIpPGB1E3rNIChENsNYXMJnVCiR0D4MdNFLE1r63TQRAyODNnwUmHd0
	 mpNZhlBAHoQk1uPAgFUv+tVeMS/5cEHvrQeBoaBcudFmcWPKvgvdwGnXXvAjurwQmP86T
	 VmtJjic0hUed0I3/KpWHu926zAIJg5c0BnqB8ygjIxH94ARPSjcke8i1TrGFQznEehA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795338374;
	h=DMARC-Filter:Received:X-Google-DKIM-Signature:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-ID:
	 X-Mailer:MIME-Version:Content-Transfer-Encoding;
	bh=8vOXTOFvnrcmfNX9TrDkyysz8FDRPCViCUHoqkPWXYc=;
	b=xutbHSPoOmSBVYGfbVsKpEQTQf+s0h7jDQ9bq9JgW1L/DJWXfZ3jKzVHys/X0JL97Tu8
	 cPBvrz03qaYgZCX1j8pfdEPKZD0mHX7inMXBKJpMGIFOL0giiIdLT8yMp4j9lvCDL2SYE
	 BvxMwkmVqPiWPy2WWMzEvhOhfUj/gLkpacA42GrSkWq8Wpt+NLIjLhEiwmQhBoGKgOuM4
	 1bDvb3b9LRJTf/UgrMOy8ikhemwXj1P7LBHvGW1LYPVJO1zulK2uAl780xOQ3wkYbWKU3
	 bVRo5Q9yUh0Q4+d+hHyjvHpxmZcTJRfnnhE8Z1XSY5L5u2QayBmcMwkazxa8vaomcKw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=fail header.from=foxmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=none smtp.remote-ip=74.125.229.131
X-Received: from mail-dl2-f3.google.com (mail-dl2-f3.google.com [74.125.229.131])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43002606A320
	for <netdev@vger.kernel.org>; Sun, 22 Nov 2026 09:06:13 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 43002606A320
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=foxmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dl2-f3.google.com with SMTP id a92af1059eb24-1521c45a248so2025258c88.0
        for <netdev@vger.kernel.org>; Sun, 22 Nov 2026 01:06:13 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1795338372; x=1795943172;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=8vOXTOFvnrcmfNX9TrDkyysz8FDRPCViCUHoqkPWXYc=;
        b=xvCR1YaKAvftKHABYj38eQNH7LxT58eNP24tmW0S/xBzGZmYGO1tj2RbfxMcZWrnUp
         QAs4WrlsXBiJGiVCOyaLdjKYZFTWSk7RvhIb9EDZYoKBVvqxzTQhDrtpALwX1zYJRIbv
         B1p6leYvoHiaVaOqw1yWk8Q0Fqvam6pBIcQLWlNxL7qT2CD+dBVRk6DnC1hWJYiMqTm8
         r1zXaXJdxw0hSMBVmUXd23oyvSTV+fIdcV0g65i/NKIFBt79JSqctgcmgda+ewpgpMwI
         nNsW67e/EhfCp0H8/iksLWKQoulR4JgfiYFh9UOXE3L2A9auwaKkSfZoFhIvQspvjeYl
         Y2Ig==
X-Gm-Message-State: APuU4Z9OAWMYipC0TOd5Wfjd6Sh3fEz3GqpumOu6P1JTnq/QKzjsA9Tk
	G+ZpPMnHRNLjA5pQCeTQgpG3KLLvmpkQ6+hFXm5iyVR9swAKShRMrYESd1XmKgtl
X-Gm-Gg: AZFdTZd+2sqVWZWGL+TZ7E4+I9MhLzy0drzvmMP5/SyHa9ad9iKtu0aIWOW3XP/uOoq
	MaCyE+XIk+stsU+RJMLIK92pUVzxrI+vk0ZRGkMxvgz4u1KZvFAg56+5Nf6AZtRboItlWwKIpMw
	E+KBg8Bh8BmAYQCfDID1ZVvo4f3v0pUW+zwW3VtlY0Lh8HHIBY7uRauVlZoqb2eKtmP4w74Ukl6
	jgHoVKW/zY4lPVRPxZNvcFSYmlfgOYfLlWwME2oCNsNoPQsDLxkbOwFB9UUHB7+HjgM6vz1qzRj
	pAfJibGWyP2af7yROyXxIx7jvni842nu7UzjTYQzKDuLExSNw86xurAIKbM15q3uUrGtHdh2vvx
	iYnkEguy0io8Oc2vZOb2/FYWD1YwYt2//dwTjdlUeXmmMylC/9mxnwoWDiIpFcMrmZDfCwIddEj
	G8+LNmJRVtIO4ihSUlgXIZhHfhRBEN4Y0nk3sslTepIKanC4TtuyafUwXT4XPpWxeeaMBoFESdv
	eo8fOkMJJ/iivYEJmRuHUR6rL/0pStTqz/n6IVd3rB3LyAATpbW31hmwwo6yvT5MZIrnbPoxdKM
	Z+jhmL5XLssEpk/4PXlpREUJCrfxuOO9UCVcHCafXHYRXlA=
X-Received: by 2002:a05:701b:4308:b0:165:aced:1fde with SMTP id a92af1059eb24-1b56f87a910mr814282c88.0.1795338372101;
        Sun, 22 Nov 2026 01:06:12 -0800 (PST)
X-Received: from localhost.localdomain ([138.199.21.246])
        by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b562a82b3fsm16839045c88.5.2026.11.22.01.06.08
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Sun, 22 Nov 2026 01:06:11 -0800 (PST)
X-Cc: mst@redhat.com,
	jasowang@kernel.org,
	eperezma@redhat.com,
	xuanzhuo@tsinghua.org.cn,
	andrew+netdev@amiga.org.uk,
	davem@davemloft.net,
	edumazet@gmail.com,
	kuba@kernel.org,
	pabeni@redhat.com,
	talgi@efi.com,
	hengqi@loongson.cn,
	horms@kernel.org,
	virtualization@vger.kernel.org
X-Mailer: git-send-email 2.43.0
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list