Thread (17 messages) 17 messages, 2 authors, 26d ago

Re: [PATCH net 3/6] ipv6: fix error handling in forwarding sysctl

From: Nicolas Dichtel <hidden>
Date: 2026-06-19 13:04:03

Le 19/06/2026 à 12:28, Fernando Fernandez Mancera a écrit :
quoted hunk ↗ jump to hunk
On 6/19/26 11:34 AM, Nicolas Dichtel wrote:
quoted
Le 18/06/2026 à 18:22, Fernando Fernandez Mancera a écrit :
quoted
When writing to the forwarding sysctl, if proc_dointvec() fails to parse
the input, it returns a negative error code. The current implementation
is overwriting that error for write operations.

This results in a silent failure, it returns a successful write although
the configuration was not modified at all. When modifying the "all"
variant it can also modify the configuration of existing interfaces to
the wrong value.

Fix this by checking the return value of proc_dointvec() and returning
early on failure.

Fixes: b325fddb7f86 ("ipv6: Fix sysctl unregistration deadlock")
The bug existed before the git era.
Maybe
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")

Hm, not really, AFAICS b325fddb7f86 is the first commit overwriting the return
value from proc_dointvec(). See:
@@ -3983,7 +3986,7 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write,
struct file * filp,
     ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);

     if (write)
-        addrconf_fixup_forwarding(ctl, valp, val);
+        ret = addrconf_fixup_forwarding(ctl, valp, val);
     return ret;
 }
Hmm, you're right.

Reviewed-by: Nicolas Dichtel <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help