Re: [PATCH net 1/2] ipv4: devinet: update inheritance state only after parsed writes

From: Ido Schimmel

Date: Thu Oct 29 2026 - 15:58:52 EST


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@xxxxxxxxxxx>
> ---
> 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.