netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6/route: Add a missing check on proc_dointvec
@ 2018-12-24 16:30 Aditya Pakki
  2018-12-28  0:18 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2018-12-24 16:30 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI,
	netdev, linux-kernel

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>
---
 net/ipv6/route.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 059f0531f7c1..5ccdaa27ec53 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -5053,12 +5053,16 @@ int ipv6_sysctl_rtcache_flush(struct ctl_table *ctl, int write,
 {
 	struct net *net;
 	int delay;
+	int ret;
 	if (!write)
 		return -EINVAL;
 
 	net = (struct net *)ctl->extra1;
 	delay = net->ipv6.sysctl.flush_delay;
-	proc_dointvec(ctl, write, buffer, lenp, ppos);
+	ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
+	if (ret)
+		return ret;
+
 	fib6_run_gc(delay <= 0 ? 0 : (unsigned long)delay, net, delay > 0);
 	return 0;
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ipv6/route: Add a missing check on proc_dointvec
  2018-12-24 16:30 [PATCH] ipv6/route: Add a missing check on proc_dointvec Aditya Pakki
@ 2018-12-28  0:18 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-12-28  0:18 UTC (permalink / raw)
  To: pakki001; +Cc: kjlu, kuznet, yoshfuji, netdev, linux-kernel

From: Aditya Pakki <pakki001@umn.edu>
Date: Mon, 24 Dec 2018 10:30:17 -0600

> 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>

Applied, but honestly running garbage collection even if the value
isn't change is completely harmless.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-28  0:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-24 16:30 [PATCH] ipv6/route: Add a missing check on proc_dointvec Aditya Pakki
2018-12-28  0:18 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).