Netdev List
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Yingjie Wang <x-professor@outlook.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"dsahern@kernel.org" <dsahern@kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@kernel.org" <edumazet@kernel.org>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"horms@kernel.org" <horms@kernel.org>,
	"herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
	"shuah@kernel.org" <shuah@kernel.org>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net 1/2] ipv4: devinet: update inheritance state only after parsed writes
Date: Thu, 29 Oct 2026 21:58:21 +0200	[thread overview]
Message-ID: <20261029195821.GA1467575@shredder> (raw)
In-Reply-To: <2b84b193384fd243fb70d9b0750cdcc9d695a158.1793283257.git.x-professor@outlook.com>

On Thu, Oct 29, 2026 at 02:30:35PM +0000, Yingjie Wang wrote:
> devinet_conf_proc() marks tracked per-device IPv4 settings as explicitly
> configured after every write attempt. A rejected integer leaves the value
> unchanged but sets its state bit, so a later update to conf/default skips
> the device.
> 
> Zero-length writes and writes ignored because their file position is
> nonzero in strict sysctl mode have the same effect. proc_dointvec()
> returns success for both without parsing a value.
> 
> Use proc_dointvec_conv() with a converter that records successful integer
> conversion. Update inheritance state and run post-set handling only after
> both parsing and conversion succeed. The converter uses the same integer
> helpers as proc_dointvec(), and valid same-value writes continue to mark a
> setting as explicit.
> 
> The issue was reproduced with ordinary sysctl writes in fresh network
> namespaces, without kernel modification or error injection. On the base
> kernel, lo/arp_ignore remained 0 after default/arp_ignore was set to 1
> following invalid, blank, zero-byte, or strict nonzero-offset writes. With
> this change it inherited 1 in all four cases, while valid same-value and
> changed-value writes retained 0 and 2.
> 
> Fixes: 31be308541e9 ("[IPV4]: Add default config support after inetdev_init")
> Signed-off-by: Yingjie Wang <x-professor@outlook.com>
> ---
>  net/ipv4/devinet.c | 29 ++++++++++++++++++++++++++---
>  1 file changed, 26 insertions(+), 3 deletions(-)

Why is this interesting? Who is even hitting this? Blamed commit is
almost 20 years old.

  reply	other threads:[~2026-10-29 19:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 14:30 [PATCH net 0/2] ipv4: preserve devinet inheritance after unparsed writes Yingjie Wang
2026-10-29 14:30 ` [PATCH net 1/2] ipv4: devinet: update inheritance state only after parsed writes Yingjie Wang
2026-10-29 19:58   ` Ido Schimmel [this message]
2026-10-29 14:30 ` [PATCH net 2/2] selftests: net: test devinet inheritance after failed writes Yingjie Wang
2026-10-29 14:34 ` [PATCH net 0/2] ipv4: preserve devinet inheritance after unparsed writes netdev-bot+sinfo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261029195821.GA1467575@shredder \
    --to=idosch@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=x-professor@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox