Skip to content

Commit f0fb9b2

Browse files
Aditya Pakkidavem330
authored andcommitted
ipv6/route: Add a missing check on proc_dointvec
While flushing the cache via ipv6_sysctl_rtcache_flush(), the call to proc_dointvec() may fail. The fix adds a check that returns the error, on failure. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent dc4501f commit f0fb9b2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎net/ipv6/route.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5054,12 +5054,16 @@ int ipv6_sysctl_rtcache_flush(struct ctl_table *ctl, int write,
50545054
{
50555055
struct net *net;
50565056
int delay;
5057+
int ret;
50575058
if (!write)
50585059
return -EINVAL;
50595060

50605061
net = (struct net *)ctl->extra1;
50615062
delay = net->ipv6.sysctl.flush_delay;
5062-
proc_dointvec(ctl, write, buffer, lenp, ppos);
5063+
ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
5064+
if (ret)
5065+
return ret;
5066+
50635067
fib6_run_gc(delay <= 0 ? 0 : (unsigned long)delay, net, delay > 0);
50645068
return 0;
50655069
}

0 commit comments

Comments
 (0)