🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22987

Re: [PATCH net-next] ipv6: Do not keep loopback addresses when MTU is below minimum

#22987
From: Hangbin Liu
Date: Thu, 26 Nov 2026 09:07
100 lines
12191 bytes
On Wed, Nov 25, 2026 at 01:17:09PM +0200, Ido Schimmel wrote:
> When the MTU of a device drops below the minimum IPv6 MTU (1280),
> addrconf_ifdown() is called to stop IPv6 on the device. For all devices
> other than loopback, the IPv6 configuration is destroyed together with
> all the addresses. For the loopback device, the configuration is
> retained and so are permanent addresses if keep_addr_on_down is set, but
> their host routes are deleted.
> 
> This results in an up device with addresses that do not have host
> routes, a state that persists even after the MTU is raised and that the
> kernel warns about when DAD completes for such an address:
> 
>  IPv6: BUG: Address 2001::fb on device lo is missing its host route.
> 
> IPv6 cannot operate below the minimum MTU, so there is no point in
> keeping the addresses. Do not keep them, similar to when IPv6 is
> disabled via disable_ipv6. This aligns the loopback device with other
> devices and with IPv4, where all the addresses are flushed when the MTU
> drops below the minimum IPv4 MTU (68).
> 
> Before:
> 
>  # sysctl -wq net.ipv6.conf.lo.keep_addr_on_down=1
>  # ip -6 address add 2001:db8:1::1/64 dev lo
>  # ip link set dev lo mtu 1000
>  # ip -6 address show dev lo
>  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 1000 qdisc noqueue state UNKNOWN group default qlen 1000
>      inet6 2001:db8:1::1/64 scope global tentative
>         valid_lft forever preferred_lft forever
>  # ip -6 route show table local dev lo
>  #
> 
> After:
> 
>  # sysctl -wq net.ipv6.conf.lo.keep_addr_on_down=1
>  # ip -6 address add 2001:db8:1::1/64 dev lo
>  # ip link set dev lo mtu 1000
>  # ip -6 address show dev lo
>  #
> 
> Other devices (before and after):
> 
>  # ip link add name dummy1 up type dummy
>  # sysctl -wq net.ipv6.conf.dummy1.keep_addr_on_down=1
>  # ip -6 address add 2001:db8:2::1/64 dev dummy1
>  # ip link set dev dummy1 mtu 1000
>  # ip -6 address show dev dummy1
>  #
> 
> IPv4 (before and after):
> 
>  # ip -4 address add 192.0.2.1/32 dev lo
>  # ip link set dev lo mtu 67
>  # ip -4 address show dev lo
>  #
> 
> Reported-by: syzbot+ded267b328e950a7c0c4@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=ded267b328e950a7c0c4
> Reported-by: syzbot+57f410c9a4f8d7a441d6@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=57f410c9a4f8d7a441d6
> Reported-by: syzbot+af16ddc8fd22a1d135f8@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=af16ddc8fd22a1d135f8
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
> 
> Notes:
>     Targeted at net-next without a Fixes tag as this is not a regression:
>     the loopback device has been keeping its addresses without host routes
>     when its MTU drops below IPV6_MIN_MTU ever since keep_addr_on_down was
>     introduced in v4.6. The only symptom is a pr_warn() message (not a
>     WARN() backtrace) that so far was only triggered by syzbot and the patch
>     changes user visible behavior.
> 
>  net/ipv6/addrconf.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index cdea18e5ba1a..285ad5c3bca1 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -3948,9 +3948,12 @@ static int addrconf_ifdown(struct net_device *dev, bool unregister)
>  	}
>  
>  	/* combine the user config with event to determine if permanent
> -	 * addresses are to be removed from address hash table
> +	 * addresses are to be removed from address hash table. IPv6 cannot
> +	 * operate below IPV6_MIN_MTU, so treat that like disable_ipv6 and do
> +	 * not keep addresses without their host routes.
>  	 */
> -	if (!unregister && !idev->cnf.disable_ipv6) {
> +	if (!unregister && !idev->cnf.disable_ipv6 &&
> +	    dev->mtu >= IPV6_MIN_MTU) {
>  		/* aggregate the system setting and interface setting */
>  		int _keep_addr = READ_ONCE(net->ipv6.devconf_all->keep_addr_on_down);
>  
> -- 
> 2.56.0
> 
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Technical Details
Message-ID: <20261126090717.GH33976@Liu-laptop>
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-371983-linux-kernel-netdev=dewy.ru
References: <20261125111709.126901-1-idosch@nvidia.com>

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-371983-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next] ipv6: Do not keep loopback addresses when MTU
 is below minimum
Date: Thu, 26 Nov 2026 17:07:17 +0800
Organization: Usenet Network
Message-ID: <20261126090717.GH33976@Liu-laptop>
References: <20261125111709.126901-1-idosch@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="422998"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ODIzp0r/4YaZb4hojlOsKJWQ7Wc= sha256:CsETCQ3YxSajlmdgRzuRKEB8I0WxLZx/C8K4LIx567E=
	sha1:pmoLL1uA89HwED7ZBCFndtEaXLo= sha256:WMZYk8DG2wYzU1IGxfT2KoJzk94Y2vFtL3JpzVQjcNk=
Content-Disposition: inline
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 1BE8C125EBB; Thu, 26 Nov 2026 12:08:17 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 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, 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, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.dev
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 To7l6tdawUpm;
	Thu, 26 Nov 2026 12:08:13 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-371983-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id C7382125EBA; Thu, 26 Nov 2026 12:08:02 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 69DFE2C51E; Thu, 26 Nov 2026 09:08:00 +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=1795684054;
	b=IEoxGG2p4zK1hs9Hz9g0XltRpLwpXzI95zDHlR1Jeri0YaKHzJwhKBYJ4Zv58dypRsi8
	 /2YdPfRBQFLYhJSQiGuVc5kpDtZOLEFEqWfZpIsEgg3HzblIWvAYS1ixTzQZUFRnkaJ62
	 k1/47zXUZ84XkdVRlZ4+fTG5VXY+HBbq381ID1X8cHzrhDtC40Z1de9DbZXZKQ6QOrxv2
	 qAvKgRXomp7z+ZIX26cwqsHkCyEdM6cG1wFknczB4BqggaDrFxC7JEiMHnvY4do/Ox/La
	 TA3PUOXijwfUvKvxpQoLLd+J7BE5/Yh0CE5C340Sid8KA/sZOst/8wv3JAlEdy5Sfmw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795684054;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=N3rhvzb+h28MvlNfZwN0zhZc4VGxf79hWWSLpBvEg3Q=;
	b=GE68FY1Fz2HvE+ryZOttGWlsKEfXCCrZLZatC3+H0DB5yM/GNadbrZM+arU8yN2UmEqn
	 gxLsqI2o73YpTZ4tslyb64VRj7IfN9q5YFV45vEdARLE7O9QZyk8AsPbusp3bH9AD1Czu
	 j1U7HIWRZJkWwZ5l190aTxu9cmLTRbFi39tdVZ8tJbnTpjqltnRUZlGr6alTwgq+70mQY
	 DZh65PxJuIuluP5kwZbQsAD8kdEtiyasqrbXmA7dPluNHQNjyFmO87po78Fe0tOc0fkPB
	 gAxEIiZxaue2isWf8DTwnKO4f/jqK+q6xQMpwV4OIDg24k6LmxSHzAENdhQfJdRkCcg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=amUVkJF9;
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	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 EDECB60A381F;
	Thu, 26 Nov 2026 09:07:33 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=amUVkJF9
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.172
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795684053;
	b=NHIA+tzzjgELrEZMT+rVOpe/1PEz5FqbDqtLKEaPSKhcF4EbZYPN5KVfbInkYksjvR2X
	 eEreTo5Xk/2PvG712V0dcfIgesRZ0cQxqNqGIYO77PM3aAuvU9jsDlrzaHFjKpn+zxtXu
	 h7ygsuUZVudYViUte64mTSpEZGFfyvSdGNSWtVGUswwBEaPOMFUmzqWqozQ7LSmOGD/xs
	 YM2bdiE9TL73VtZPZob+zmCHJc6Y7Y3EzhHR4JP+IizzNHBhwjofKsGoF1Y1/zbItiiRE
	 AMiNnBsb7RELKFQbPZB0j6oUKFnpSFEFGr+5eidaiyEATaj7OFZRUjrjlCZ2/Sym17Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795684053;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=N3rhvzb+h28MvlNfZwN0zhZc4VGxf79hWWSLpBvEg3Q=;
	b=U8r9nfBsA4r3JpVeBhSTBGnHudURetqJQIxyJa8/c8leHVF3TF/yB/nqUiS+bO18xUWV
	 aMX3oPK20zSV7s9fwt1ViK0vRW9URdgwiGhSy1BTJYxcw50GcVJQu5lkjaOwTUXuWL3yW
	 gDz3j4g28cg/1r81gsKs9cjKt5o26NrF6fdxfA1OTHfIRxnm9eMNcGiIL55f7KXULLda5
	 PW5cPlYYv79X2OASIrR8shJqMSv7UQ0AqHhiCCD/OfU1YLYtKghLfft6hJWc3JusZegWj
	 vDO6Ko70hAp+PJuFoAw4vr0kymGIbrFfceiP9BRmZXA+jk5q2BJ7EdCLQD07VHFL9Mw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=amUVkJF9;
	arc=none smtp.remote-ip=95.215.58.172
X-Received: from mta1.migadu.com (out-172.mta1.migadu.com [95.215.58.172])
	(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 DD73760A2638
	for <netdev@vger.kernel.org>; Thu, 26 Nov 2026 09:07:31 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DD73760A2638
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=POEJ5Y1wEVWjdL2mnds2Wh5HHh6t0AOQagRcRKfgwZU=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1795684049; v=1; x=1796288849;
 b=amUVkJF9Bwj9/6b21VkxsSr6UNGkYdtXmi5rBccl/vefcSPpQtjQJtphRCGU32jPucCATy9I
 kaAmFjwmVpy/hI5e6ZQWQ49ov6SZshSJyRkfBiqpPv53ZJ0DYdrCbqTCTQDDMLfHBTruCh/bki+
 iAOzbfZRo7nFmFycaATaIJrc=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta11.migadu.com with ESMTPS id a6186c7db64e534f;
	Thu, 26 Nov 2026 09:07:29 +0000
X-Mizu-Trace-ID: a6186c7db64e534f
X-Migadu-Flow: FLOW_OUT
X-Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, edumazet@kernel.org, dsahern@kernel.org,
	horms@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
X-In-Reply-To: <20261125111709.126901-1-idosch@nvidia.com>