🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #14378

Re: [PATCH net-next] ipv6: reset all.force_forwarding when disabling all.forwarding

#14378
From: netdev-bot+sashiko
Date: Wed, 11 Nov 2026 03:53
139 lines
13364 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 2 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] In net/ipv6/addrconf.c, addrconf_fixup_forwarding() (lines
  908-915) now sends inet6_netconf_notify_devconf(net, RTM_NEWNETCONF,…
- [Medium] ipv6: missing NETCONFA_FORCE_FORWARDING in
  inet6_netconf_fill_devconf()
- [Low] The patch fixes a user-visible bug but has no Fixes: tag.

--

ipv6: reset all.force_forwarding when disabling all.forwarding

When all.forwarding is disabled, this patch also clears
all.force_forwarding, so that writing 1 to all.force_forwarding later
re-enables the interfaces. It also sends a netconf notification for the
change.

> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index d9d13e78bf13b..9007a58039e65 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -905,6 +905,14 @@ static int addrconf_fixup_forwarding(const struct ctl_table *table, int *p, int
>  						     net->ipv6.devconf_dflt);
>  
>  		addrconf_forward_change(net, newf);
> +		/* Disabling all.forwarding also resets all.force_forwarding */
> +		if (newf == 0 && net->ipv6.devconf_all->force_forwarding) {
> +			WRITE_ONCE(net->ipv6.devconf_all->force_forwarding, 0);

[Severity: Low]
Should this patch carry a Fixes: tag for commit f24987ef6959, the commit
that added the force_forwarding sysctl?

That commit added the per-interface reset in addrconf_forward_change():

    if (newf == 0)
        WRITE_ONCE(idev->cnf.force_forwarding, 0);

It did not reset devconf_all->force_forwarding. Because
addrconf_sysctl_force_forwarding() only acts on a write when
old_val != new_val, writing 1 again does nothing.

Without the tag, stable kernels that have force_forwarding may not pick
up this fix.

> +			inet6_netconf_notify_devconf(net, RTM_NEWNETCONF,
> +						     NETCONFA_FORCE_FORWARDING,
> +						     NETCONFA_IFINDEX_ALL,
> +						     net->ipv6.devconf_all);

[Severity: Medium]
Does this notification carry the force_forwarding value at all?

inet6_netconf_notify_devconf() sizes the skb with
inet6_netconf_msgsize_devconf(type) and fills it with
inet6_netconf_fill_devconf(). Neither helper handles
NETCONFA_FORCE_FORWARDING. They only know about NETCONFA_FORWARDING,
NETCONFA_MC_FORWARDING, NETCONFA_PROXY_NEIGH and
NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN.

So when all.forwarding is set to 0 while all.force_forwarding is set,
RTNLGRP_IPV6_NETCONF listeners get an RTM_NEWNETCONF for
NETCONFA_IFINDEX_ALL that contains only NETCONFA_IFINDEX. The size and
fill helpers agree with each other, so WARN_ON(err == -EMSGSIZE) in
inet6_netconf_notify_devconf() never fires. The message without a
value goes out silently.

An RTM_GETNETCONF request that ends up with all set in
inet6_netconf_fill_devconf() also omits force_forwarding. A listener
therefore cannot recover the new state by querying afterwards either.

The commit message says netconf listeners are notified. With this
message they cannot tell what changed or what the new value is.

The gap predates this patch. The existing force_forwarding
notifications in addrconf_sysctl_force_forwarding() and
addrconf_force_forward_change() have the same problem. This patch adds
one more caller that depends on that path.

Could NETCONFA_FORCE_FORWARDING handling be added to
inet6_netconf_msgsize_devconf() and inet6_netconf_fill_devconf(),
either as a preceding patch or in the same series?

[Severity: Medium]
Does this notification actually carry the new force_forwarding value?

inet6_netconf_fill_devconf() only puts NETCONFA_FORWARDING,
NETCONFA_MC_FORWARDING, NETCONFA_PROXY_NEIGH and
NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN. It has no branch for
NETCONFA_FORCE_FORWARDING, so for this type it emits only the ifindex:

net/ipv6/addrconf.c:inet6_netconf_fill_devconf() {
    ...
	if ((all || type == NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN) &&
	    nla_put_s32(skb, NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN,
			READ_ONCE(devconf->ignore_routes_with_linkdown)) < 0)
		goto nla_put_failure;

out:
	nlmsg_end(skb, nlh);
    ...
}

inet6_netconf_msgsize_devconf() reserves no space for it either. The two
helpers agree, so no WARN fires.

As a result, RTNLGRP_IPV6_NETCONF listeners get an RTM_NEWNETCONF for
"all" with no NETCONFA_FORCE_FORWARDING attribute.

The commit message says "Reset all.force_forwarding too and notify netconf
listeners", but listeners cannot tell from this message what changed or
what the new value is.

The missing fill support dates back to f24987ef6959. The existing
force_forwarding notifications in addrconf_sysctl_force_forwarding() and
addrconf_force_forward_change() have the same gap. This patch adds one more
caller that depends on that path.

Could NETCONFA_FORCE_FORWARDING branches be added to both
inet6_netconf_msgsize_devconf() and inet6_netconf_fill_devconf(), either
as a prerequisite or in the same series?

> +		}
>  		if ((!newf) ^ (!old))
>  			inet6_netconf_notify_devconf(net, RTM_NEWNETCONF,
>  						     NETCONFA_FORWARDING,

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261109-ipv6_reset_all-v1-1-815dfd508246%40proxmox.com
Technical Details
Message-ID: <179436921928.2199510.2583920348009853721@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360841-linux-kernel-netdev=dewy.ru
References: <20261109-ipv6_reset_all-v1-1-815dfd508246@proxmox.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360841-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next] ipv6: reset all.force_forwarding when disabling
 all.forwarding
Date: Wed, 11 Nov 2026 03:53:39 +0000
Organization: Usenet Network
Message-ID: <179436921928.2199510.2583920348009853721@kernel.org>
References: <20261109-ipv6_reset_all-v1-1-815dfd508246@proxmox.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="769490"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:gu7QcE+gZQVeXZPj67TYbYPMHGU= sha256:/k6Sd2sD5fKp8xobuBNqHMHbMA6uRZ+rjRryUutY1fE=
	sha1:n1J1hoP3TV/+pRMehcNmuBkEif4= sha256:trO50y9Ym1Sco8sn7kizgNaVmO6Ni8bikJnX3ti5GcE=
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 5F414113E12; Wed, 11 Nov 2026 06:54:32 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	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 (2048-bit key)
	header.d=kernel.org
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 3yFPx152tiyy;
	Wed, 11 Nov 2026 06:54:23 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-360841-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id E7116113DF1; Wed, 11 Nov 2026 06:54:13 +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 835AFA3C0B; Wed, 11 Nov 2026 03:53:46 +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=1794369226;
	b=LV5oc5kKDKZydmMVRlEy7ZtulK2oDxJDkvToBzRUmnkM3UJTV2tCCunrjZ0MqT2UNTmg
	 wBaO+76gXqIttvNf6aYjTc2qhmmcBKCdPkoiSbTqaMnTzg9ECBK1u3IF1hA2q4expFXGX
	 WbXCZnq01QVaBgm/lgPluh3+jrlgWytIlUqz/v0psOx6x9ZxRy8czbdL5J7Hjispf3Mop
	 DqKrL/nS9DjiZnPf1yezuHzQ+KWkll5B7LYszkrOq55yaGrQ+8YdLQ0tHiUakbHLwU4S/
	 V6RxRz+5Ot/WdvegR7dlpKTWCOw1RvxNAH3d8cAKKvEMO2FTTFLhO8f7grPolPjF6Bg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794369226;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=Q27sCdgw5KbTydJOFwO5gJVQdyRu6rjlWeERILgdeAY=;
	b=E7o5QAlLLMN4o8/7SR0y8bzT2d6D7JZjo4Tk+/0rb49siprp+MzH3IeJ25tLAAJ5ImUF
	 /yVVFnbLLTkPdkl+GgqJVmhy5BADMOdn7hevO37zYHOZ4/AZdZJeImyffmj+X0heL7f6F
	 C6rjcPDzXC/+xnKeefnhpft+2Kka2L1ccaNude0gX+qqUgFs8VjKsMoMdEOrBsUEbFoPq
	 Xj6ljC0/sBxvexQzFlyUio3fK2lm1sZGw3/dvknmvRah4BSyVnU3ay+RqTs/ummbVINTy
	 siYWwVX5KRYM/8fTbeSqmPL6vNrcq8DAKEX4cDEPYoYHeNmWe6FF9wO4WE4YmgTe7LQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hL4jG5ni;
	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 577E1606A32A;
	Wed, 11 Nov 2026 03:53:46 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hL4jG5ni
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794369220;
	b=oF/bo1QN6rZt/5YFhR8d8CXzYhK/jPw8BFfzaj41Ce+QaNmAMLm+ZaYocJ2FlsZspZs/
	 7Q3tR5KwG0qbj6tq4DaOgZT0CBjS5dlJKyKd1kt4jDXAunVgDq9N8IlNf9A4nAoMmvbCt
	 l7dYpC6GbFuTOc0hOk8auB3IQZ+Gg3KZZi0nOlS/87M355no8Ov7i1OLiexwBGn+ac+Fe
	 0lLrgMAG8dLmYdT81M8PuknMEa+HG5/M1Xc0JOxczqcIwJilWMPsdzWEMmUJBhdLOd80x
	 7NxSV/L6W1GtgxFjNr2QF4zumTokX7Sgoz7brFCw1+zPeIZ22eSnX/KokQrMryzgtSQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794369220;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=Q27sCdgw5KbTydJOFwO5gJVQdyRu6rjlWeERILgdeAY=;
	b=a0+8kOHXCFZLHJSRuYtCR4lmtAwky/znaelKACgkFX4pRMg7y1poVbVOo4TsDVmNmrjF
	 yJgmAKnfg3yWBf0FwVNicFT9Ao7LK4148wZWmvtrwWOETR/Bks1C+YBfMZCWaHFkJwPYX
	 BnRyV538fdrIkXUmgC4lr4CSGpDVudJxgggg0sHX0J9Tkq1XmTSkG3bhDREOxrMHsrgEl
	 ADJ4I7WeThcm78NVi91Ac8icUwCv19fttQZ9YUdS8OIxTt8GwdjAwFjD9L8ehFqQ1/uky
	 4HgSL4WdztBibkDk8QTg5NNQxrwjBsHUqpoTfsPpx/LbsejOng5b29kL8APbIG0Wq0Q==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hL4jG5ni;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71D1A606A31C;
	Wed, 11 Nov 2026 03:53:40 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7A9D1F0089F;
	Wed, 11 Nov 2026 03:53:39 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794369220;
	bh=Q27sCdgw5KbTydJOFwO5gJVQdyRu6rjlWeERILgdeAY=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=hL4jG5ni2rK845OegRRFfXwmi03Zz2cFWIW49ds1r9HnmzWVfjb9idlGoYNDulpDp
	 LN9pQkqg+wGaKi4yIvhKdm/qZPoRHmfMyohljjKNc/UImBZdvwCzkgn/rCpOIv8vKi
	 YHf5aT1dxc5fAI+ttkIUkgZNlXE39KDQinMkD4KT63a1UKTguT9VVSA32BtFzw+fDT
	 tjrwngcdymNhjpJBJfDGRWKQyiUugdhLR2z626wpah6LvnaNowELL8dmlaauSB1qsX
	 HoGeC2zgWZ5WXKlidemQbSNqyReEizLy81FjC6SBC88Swbpwy3taP6D3trTvoMVgng
	 Golt5mPZdumDw==
X-Cc: dsahern@kernel.org, idosch@nvidia.com, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
 netdev@vger.kernel.org, linux-kernel@vger.kernel.org
X-In-Reply-To: <20261109-ipv6_reset_all-v1-1-815dfd508246@proxmox.com>
X-sashiko-severity: Medium
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