Article View: linux.kernel.netdev
Article #25198[BUG] ipv4: unregister_netdevice hang after flushing a DVMRP tunnel vif
From: Yu Junzhe
Date: Tue, 01 Dec 2026 11:52
Date: Tue, 01 Dec 2026 11:52
75 lines
13847 bytes
13847 bytes
Hello,
I am reporting a netdevice refcount hang in IPv4 multicast routing.
MRT_ADD_VIF with VIFF_TUNNEL creates a dvmrp<vifi> IPIP device. MRT_FLUSH
with MRT_FLUSH_VIFS_STATIC removes that vif and unregisters the device, and
the unregister wait never finishes. The kernel prints:
unregister_netdevice: waiting for dvmrp3 to become free. Usage count = 2
netdev_wait_allrefs_any() returns only when the count is 1, so one reference
is still held. This needs CAP_NET_ADMIN (root in a new network namespace, no
user namespace). I do not claim privilege escalation. The result is a local
hang inside the flush setsockopt.
Summary
=======
On Linux 7.3.0-rc4 (93f51579e, tag v7.3-rc4), net/ipv4/ipmr.c:
ipmr_new_tunnel() issues SIOCADDTUNNEL on tunl0, names the device
dvmrp<vifi>, opens it, then dev_hold() and dev_set_allmulti(+1). The
reproducer does not call MRT_INIT. CAP_NET_ADMIN is enough for MRT_ADD_VIF,
and the socket is not the mroute socket, so the vif is VIFF_STATIC.
MRT_FLUSH (value MRT_FLUSH_VIFS_STATIC) calls mroute_clean_tables() with a
kill list. vif_delete() clears v->dev, dev_set_allmulti(-1), queues the
device with unregister_netdevice_queue() because it is VIFF_TUNNEL, and then
netdev_put(). unregister_netdevice_many() runs after that. The wait is in
the later netdev_run_todo() path.
So the ipmr hold is dropped before the wait. A stuck count of 2 is some
other reference that is still alive when the wait starts. I have not pinned
which one. The program also does one sendmsg on a still-open AF_INET6 raw
socket between the add and the flush. That socket is open for the whole
wait. I am not claiming that dst is the leftover hold.
MRT_DEL_VIF is a different order: a NULL kill list makes
unregister_netdevice_queue() wait inside vif_delete() before netdev_put().
This program uses MRT_FLUSH.
Guest log from the minimized program (2026-11-18):
[ 47.264753] dvmrp3: entered allmulticast mode
[ 47.265016] dvmrp3: left allmulticast mode
[ 57.280310] unregister_netdevice: waiting for dvmrp3 to become free. Usage count = 2
The ten second gap is netdev_unregister_timeout_secs. A packaged QEMU guest
on 7.3.0-rc4 (93f51579e) running the minimized program with syz-execprog
reproduces the same wait line. Config: CONFIG_IP_MROUTE=y, CONFIG_NET_IPIP=y, CONFIG_IP_PIMSM_V1=y,
CONFIG_IP_PIMSM_V2=y. CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set.
CONFIG_NET_DEV_REFCNT_TRACKER is not set.
Reproducer
==========
Syzkaller program, sandbox none, one thread. unshare flags are
CLONE_NEWNET|CLONE_NEWPID|CLONE_NEWIPC|CLONE_NEWNS|CLONE_FILES.
unshare(0x68020400)
r0 = socket$igmp(0x2, 0x3, 0x2)
setsockopt$MRT_ADD_VIF(r0, 0x0, 0xca, &(0x7f00000002c0)={0x3, 0x1, 0x9, 0x7, @vifc_lcl_addr=@broadcast, @dev={0xac, 0x14, 0x14, 0x1d}}, 0x10)
r1 = socket$inet6(0xa, 0x3, 0xff)
setsockopt$SO_TIMESTAMPING(r1, 0x1, 0x25, &(0x7f00000004c0)=0x6700, 0x4)
sendmsg(r1, &(0x7f0000000000)={&(0x7f0000000040)=@nl=@unspec={0x0, 0xff00, 0x0, 0x80fe}, 0x80, &(0x7f0000000140)=[{&(0x7f00000001c0)="b1b55feb45ef2b41bab2f4e24c5941c38be94acafd45f150ff54a2fd9aaefb5379116f0bf38357e8", 0x28}], 0x1}, 0x4048844)
setsockopt$MRT_FLUSH(r0, 0x0, 0xd4, &(0x7f0000000000)=0x8, 0x4)
MRT_ADD_VIF is optname 0xca (202). The vifctl is vifi 3, flags VIFF_TUNNEL
(1), local 255.255.255.255, remote 172.20.20.29, so the device is dvmrp3.
MRT_FLUSH is optname 0xd4 (212) with value 8 (MRT_FLUSH_VIFS_STATIC).
The hang starts inside the flush setsockopt, not at process exit.
Thanks,
Yu Junzhe <junzheyu1@gmail.com>
Technical Details
Message-ID:
<20261201115248.289-1-junzheyu1@gmail.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-374984-linux-kernel-netdev=dewy.ruShow 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-374984-linux-kernel-netdev=dewy.ru
From: junzheyu1@gmail.com (Yu Junzhe)
Newsgroups: linux.kernel.netdev
Subject: [BUG] ipv4: unregister_netdevice hang after flushing a DVMRP tunnel vif
Date: Tue, 1 Dec 2026 11:52:48 +0000
Organization: Usenet Network
Message-ID: <20261201115248.289-1-junzheyu1@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="1701497"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:j65kjIRKXYDS6xTdKlEtC2K5oZs= sha256:wkm3t7CVoYMPdDETEXaGH0WL5/26DUosRMGuynnHhpc=
sha1:eSwnpoDUyRkSCpWGd7aKe7BnL9Q= sha256:lImrhocIsyiIWMygrKYt3t2CQ8DqFkn4EwUCCnWzHhs=
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 67B94117351; Tue, 1 Dec 2026 14:53:11 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-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, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
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 no85Yug0Cwh8;
Tue, 1 Dec 2026 14:53:08 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374984-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id E0D7A11733E; Tue, 1 Dec 2026 14:52:58 +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 283012A806; Tue, 1 Dec 2026 11:52:55 +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=1796125974;
b=Ov2Mrs0cc8/6LEi44oHfepHd6BKLNQwpgcCJHoog3Qdv12yfXEqlOCZUxAJ0zNvZOjBc
zvP/y3tgD0WUcbK6f5LONjugZEbWtBb1aqN/+V9eg/WoTORvWNv1gimjCsYBGjGiWZzhy
PQ65ZBDf75iCUwJZOI7gphD3Hxxov+YSJOcD5l9UXhWHauqA2W+Sc8Ob5nqfp2HEmyWux
CAUGHIJ0cABQSroIyeF1hL3R1J3dOgRm+Ryt94mfiPZ80Ilzy+JZpeOi/hxyAhNiwfKjm
3tw6Pv97/B8EhQ0wR0S2b7vVTrnklDjmRzjcq6tGVMrw8Yng76EsSg2Sy4d3dyIbRGg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796125974;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
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=Je7fSDZI6vcphad2LPLcjLauc1m88KTZVAPbNja423Y=;
b=bb4BS5JhzsJk4+C6Vrt3cV3Sagm4FWBXXG0l0SE2xz6MBj262hJX8oCSzy0Ok2dl5Fp+
BzRget2mA9XD5+NQXDiQcpWQCLPHtwnTC3sJJy7gNX5hX6WDaECwnOjXA9I3GozPcGAdB
4AO3qTJQ3aeruzl3S9/dHjDXfZRtkjordiBDH/HL18cilXxuOyqXYTE8UWMIJqN1XUYQP
npBNI2kNrb/a3hId5xBkQTml2BPH4TX9W5DrU6qU5eNIbQRTOrfLw36dg8FVW6AA1X51f
6QAXaV4P0ZQBFlCGLEnGWB4QAFo/ww5pwEkWZbduaHpLu1jcOHOy8uv9SGJNSXHaSCA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=inR7fUIU;
dmarc=pass header.from=gmail.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 953C6606A332;
Tue, 1 Dec 2026 11:52:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=inR7fUIU
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.180
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796125973;
b=PjQy7paPfm6QPxi5lkevDM1HKC8m1FAHgV7j4Xr1nQ1ndT0xMqrkf7q2RtiEZwRv0uTD
Hw2wihmexQ81S7UlJ/47jX57vyOnUSv4snNIEmvwCjeDxj17mPCcm+WZUYQjJBoQRJn2a
eudEAOmKbqzlv643uCazp1B1NUQservcbDfR6i1VWfKvNeTK0BO5SPmVe9+K4XPDlT1Ce
ZgANDWtaGCqlEhyiGm7Kcr6iB9CoN4up9tOYT6exxjReIEwqOu/mArKZq2zXhSMKmUnCs
+180sidGkP5g6wTTVRhLcRieBo8bYnfY038N3Z5m6aSaIz9pibNzoDCkSK1Oij5k9ng==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796125973;
h=DMARC-Filter:Received:DKIM-Signature: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=Je7fSDZI6vcphad2LPLcjLauc1m88KTZVAPbNja423Y=;
b=ju5Agpz9mVQ2/pFs1ZLxPC08kbTbBlS1V/PPiEoyTz5Qb1d25kZteDZ5hPro+JldAfJb
TIZOPADH8oZnbKbW+tITOGclKpfMZDH1B558ccOHav2+7jmVGle/L5UKLQVtQUjIdu/fS
JpI3UIK+3Q/c+/DcN4BZuNnLgkrIHzjhvwPidjKTjZR98HlQY5cpBazfRHfw4EKCyhIfd
1nVW+BQkc3RHc+Vr3ubTtRHu48zEezyAkw1kXZJDmGDCWrULXRj5ErqhrPK7ufu9bv7gU
J5vmRiilQp/9DfrkZWBJBxd8etx9cNY3PMfTIVBNUO2T/QJxp08CgCZ3VUnDpqnQYDg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=inR7fUIU;
arc=none smtp.remote-ip=209.85.214.180
X-Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180])
(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 63012606A31A
for <netdev@vger.kernel.org>; Tue, 1 Dec 2026 11:52:53 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 63012606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2f11b4d6484so5345765ad.3
for <netdev@vger.kernel.org>; Tue, 01 Dec 2026 03:52:53 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1796125973; x=1796730773; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=Je7fSDZI6vcphad2LPLcjLauc1m88KTZVAPbNja423Y=;
b=inR7fUIU4KYVuruBCKeQqxiAYkKfog59J7xZqzSPhEryGNiXuObIo/HvYMnPjh4ufL
y9jdiEJ+A2VzbivtOwxYsflkKwXfwwgqO0GdCrlav9IUO0LHdXk+HD2VBUBP8Tn9Fcna
I0GQnyqQ494ENGohyUpFLIYMl36PRUNSS+nt/Kmtk7Vi/1WFid8yDSJepxCdgZP3pGvP
y9g2p8MxUoEPWDl0e2BH0zqi9MKQ2i/wJ/7V0vpjsYBiQrYqZDsCmWJ19MIM2MNR6kzQ
Qh6xaAZPghlw9VMSrQ/KGvVnaGAyYnrm7CyVaAAINOeXOvOs/I/5jCy1MrvU1iKnx9Yz
34DQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796125973; x=1796730773;
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=Je7fSDZI6vcphad2LPLcjLauc1m88KTZVAPbNja423Y=;
b=IdXmSh4/f+T6rJoSFQlXA3qw2T8AYRLqzqX6/L8ckUq8GEa775Zmnm2lFKUjy4LXNI
LlSOuEBNBUrL/RmT1I8We2RT4IQ9XqNQplFHWdOpn+G3eW/5vhOlQQrlVQkF2jvy7uyA
9MwQhRF6GF3ml1hYl2ccgIfZpv6DHo78nKBdPs0GOfbFSMjUsIMYfZCRG+xNbw28HzvB
O8bLK1DAzmmH9JSQoANWVe/n49oMtFamFJMK2CijjU/gbzvk8+sfmB+P98Y1aDnGWpwc
SpxLAhLzrsi7ZaLpgSVbLxR8DhTFgco7UGOJAwUh8llbHp0UBhEb66LOx5i1Lf72j098
XWUw==
X-Gm-Message-State: APuU4Z8CHXRWWSbVgH3dJaYrGoQLI0OWmDeKv7hdNUODC/72gcyv0Vvh
T1//nIXB3nCa0AZt3LcBX97PKwcmTYsN1reIqeKDs5eTeY6A/uHUVUvb
X-Gm-Gg: AZFdTZeKOV3/Oj6Vm16UV109NYgn7gM3fu4D3Ex7f+jhFF64qHCHsFzW7aoaWKJ8ikR
meiyK0T4obrgWlnIGDG3V9NeCmvejAOrCzbs675CXMJFZBesCKTxnwToAqp8twBKB/xYZd7gNsx
8fL3PdGO0/FhmiFvb3si7a3CfNhrK1b6wiDn7zfb97kQ2hePpRjz7ZKwc5SCAvygJtAW99u5Cnc
QHW0XKbV+FeYDo7jT5hcvuZdIkAN4gDNvmhrk7+XqSKbPNhWF7Y23wMIqkDNNxQCiooQY6WGf9n
Yws/NsqMnsAmqJogVf3FN/LCXOEyOdnxefof4zaxBPtO3iOHs74UNTqbwUVFL3cJh3Xr2ErOUow
aG9NaDKpNRLDp9Er71aKm9NckAIzscrrkwgdkcB5l7YGQRscYRTqNhmt+B4PkmtXUsukUvpsRCM
msUkqMSva9Dkb9TqCuLdWMmmHRO2VCR8e3tRQU2W1cFZaHP8Bzzf0wQDuVKBQdEG4L8n1yVZKcX
hqxmEJfw5hCMtYsoT2RKcXMORm2p84ahdahjsRpjdBITe2ataLngpN3pSeyjQG8I2nKm/Frei4u
Vd1VecxkUsAYHHqr/ZgPl1A7Hz/opI72dG8rxz+J4pY2xDHfkw==
X-Received: by 2002:a05:6a20:9f08:b0:3ef:2f72:c7e5 with SMTP id adf61e73a8af0-4014ae6fe31mr61947940637.2.1796125972510;
Tue, 01 Dec 2026 03:52:52 -0800 (PST)
X-Received: from security.datascience.hku.hk ([175.159.181.20])
by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c87343f83dsm19771877b3a.39.2026.12.01.03.52.50
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Tue, 01 Dec 2026 03:52:51 -0800 (PST)
X-Cc: netdev@vger.kernel.org,
linux-kernel@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