Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Aditya Pakki and committed by
David S. Miller
f0fb9b28 dc4501ff

+5 -1
+5 -1
net/ipv6/route.c
··· 5054 5054 { 5055 5055 struct net *net; 5056 5056 int delay; 5057 + int ret; 5057 5058 if (!write) 5058 5059 return -EINVAL; 5059 5060 5060 5061 net = (struct net *)ctl->extra1; 5061 5062 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 + 5063 5067 fib6_run_gc(delay <= 0 ? 0 : (unsigned long)delay, net, delay > 0); 5064 5068 return 0; 5065 5069 }