Article View: linux.kernel.netdev
Article #20409Re: [PATCH net v3 0/2] virtio-net/dim: fix irq moderation init failure unwind
From: Jianlin Shi
Date: Sun, 22 Nov 2026 11:37
Date: Sun, 22 Nov 2026 11:37
16 lines
10087 bytes
10087 bytes
I noticed this while working through the virtio-net probe error paths. It was not a production incident and not a syzbot report. I did not hit the allocation failure at runtime, so there is no stack trace. virtnet_probe() calls init_vqs() and then virtnet_init_irq_moder(). If kmemdup() fails there, the error path does "goto free" and skips virtio_reset_device() and virtnet_del_vqs(), so the virtqueues and their DMA mappings leak. That only happens on ENOMEM during probe. The dangling dev->irq_moder is not used on current mainline. That failure path never calls net_dim_free_irq_moder(). Patch 1 is only there so the unwind in patch 2 does not use-after-free the object. Jianlin
Technical Details
Message-ID:
<20261122113703.30415-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-368672-linux-kernel-netdev=dewy.ruReferences:
<179533878871.3294.14009692721054097098@kernel.org>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-368672-linux-kernel-netdev=dewy.ru
From: shijianlin11@foxmail.com (Jianlin Shi)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v3 0/2] virtio-net/dim: fix irq moderation init failure unwind
Date: Sun, 22 Nov 2026 19:37:02 +0800
Organization: Usenet Network
Message-ID: <20261122113703.30415-1-shijianlin11@foxmail.com>
References: <179533878871.3294.14009692721054097098@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="3622950"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:sfC+prt5SniHjNRzHixs+oo86Vw= sha256:P9Zdei5jnQGE78U63Pufynr4OKtx2bz/9yVnIMV/GFY=
sha1:i3T07eZ9weRAZWufaHVf/3tYqtg= sha256:ZqgOgrxauf7hA4nmccqiLlkOjBrezTbbZ03n3zhI0Bw=
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 38731125D75; Sun, 22 Nov 2026 14:37:37 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: 0.509
X-Spam-Status: No, score=0.509 tagged_above=-9999 required=6.31
tests=[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 jRGwfMwaX_Os;
Sun, 22 Nov 2026 14:37:33 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-368672-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id 60199125D73; Sun, 22 Nov 2026 14:37:29 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sto.lore.kernel.org (Postfix) with ESMTP id 06C50605939; Sun, 22 Nov 2026 11:37:29 +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=1795347448;
b=q0YcZz9a0y1V9HAdVfrq4A+uMP3d2Tejr7k4fpLGB4wJ+vEy7NaHDsbCRx+LwfzIGO6i
ej1FafHZfNGej4Xq4QOskeXECP+oT5kE+P46pZDlEYq3X2nCa2vLJxRYraBq84iG3t5Qa
JgAn3XOyTaavo93QHFhI6TvkLqSHzj/aopriqW2LsAe3GdY/0U3NEszZyTV8GsbAOVmzT
FDe8HS7yIfamdq3pC4/Je8OKnQsVktEEfFLFqIfkgwo4uht0wJUeJYp3r+BfVc550OWzX
L59lnf8gdFmYmbh1rpJ5p6P8Q2xAJNPwzq0L7mC5Op3GwCIEkXUNb6ls1wa7eFjGcQA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795347448;
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:In-Reply-To:References:X-Mailing-List:
List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
bh=Gn+/1uCQ6mxawzpB0lRomnzHhX1NF/CsbSiAljPSAiA=;
b=gtcKlI27xWLLqNHc7rJG6gKEQKLPbR3Cvq8FhR1n0Bs0bkelGFJV9Srmv3MzlGtsqfMv
A8SKoHIZqJOmo9c7FxMUw1rNh9xR8C8NJ9tzLaiK7YTYQc7iLVP+JkcrsnjS9lp3bxaEp
shbNZ5lOVr88n39+6q6BhDA3LQsl67gU93g7gtQfsRQAy9K666bhQKTFaV4nQiuIOXLKm
kzGa1fWgKu4twhrOPzOy+zhO1WSDPOeA+RShl6MoERanKAGp4f+ZkrFcf4kcGXCQI+wxD
Fn0YNEXTK7ng/tedIXdHMcrZTpjF3WgQHppcbob5gn6MrnzeqF17XYF1zxVybmwOf9A==
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 954E5606A33A;
Sun, 22 Nov 2026 11:37:28 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.227.128
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795347448;
b=ceLHXGAfy2C0gqxZlBFLmP+DJJUXlVUPUTAxroT25K7GuK3z0+09Vnq9lVnnEkYmQj4Y
NRaz6vZEV8cqC8IaByqXRSinyPzqKYLyMg5RjEWda9sJZUNejRrK41KTDXbPMtG0voN7q
rw8Gl7b3eVCGiWJmjYzbzdDVEwI0q9CsWczAVA/o35z8WD9GXEFL1bwp7mHkMUEmSjfsT
udgaXlPdxdHRN4As6E9brOWL+wQRIHCVP3u4UbCu4R85hNFqbSJJd/WP4k4htADSo43pQ
2DzJV7w6OyHED6AiWNd0mUjjIEj3SgC8N5gKr/i1XTT7ULHwRE8Fw0hcBTa0OZa4vrg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795347448;
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:In-Reply-To:References:MIME-Version:
Content-Transfer-Encoding;
bh=Gn+/1uCQ6mxawzpB0lRomnzHhX1NF/CsbSiAljPSAiA=;
b=n9MM0Wca9+IFuRy7ErQcBnnZ0WZv+iFA6qPazKczO6i+gieg8Jnqx2n8xCUHH7UsW/K4
coPuTOUYhdwzUWYQW9F/Lu54ObVS/gZ0OPPnBP2WgKFI3FxNMRjMPmntevok+DaRxjuJa
0gd144nDv2e6HZRkHFcYJ7Y2uJ3g4fMpvUGSYiPMx+44K4AYtyMQdw/zXTeg3NQy+N7CO
WSHNwg6QxSdoZzUNxDvIITjCCRp8IOc+XdYg9bmP5Fh87Sop3bGljw1Ythae3lylgUu+F
6Qy/YRPdEn2mv3e00cacsZlJkjtKRB37wcezB9KPpyLKiH1bzDYi3H6JMdWpd16653Q==
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.227.128
X-Received: from mail-pj2-f0.google.com (mail-pj2-f0.google.com [74.125.227.128])
(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 E2FBF606A32C
for <netdev@vger.kernel.org>; Sun, 22 Nov 2026 11:37:26 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E2FBF606A32C
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-pj2-f0.google.com with SMTP id d9443c01a7336-2ed216ed287so14244035ad.1
for <netdev@vger.kernel.org>; Sun, 22 Nov 2026 03:37:26 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795347446; x=1795952246;
h=content-transfer-encoding:mime-version:references:in-reply-to
: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=Gn+/1uCQ6mxawzpB0lRomnzHhX1NF/CsbSiAljPSAiA=;
b=YteEZWUaCXuUAMcSAvoC2mqWB2PMiocCi6guig9qk+OYSAMSOnAk7NaVJ0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Ppcj4Jo7wg==
X-Received: by 2002:a17:903:2b0f:b0:2ed:edf:4e7b with SMTP id d9443c01a7336-2f03f249c51mr86538085ad.38.1795347446143;
Sun, 22 Nov 2026 03:37:26 -0800 (PST)
X-Received: from localhost.localdomain ([138.199.21.246])
by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f03f10c9casm36633105ad.52.2026.11.22.03.37.20
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 22 Nov 2026 03:37:25 -0800 (PST)
X-Cc: netdev@vger.kernel.org,
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-In-Reply-To: <179533878871.3294.14009692721054097098@kernel.org>
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