Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 2652

kernel-2.6.18-238.el5.src.rpm

From: Neil Horman <nhorman@redhat.com>
Date: Tue, 21 Jul 2009 12:09:59 -0400
Subject: [net] fix unbalance rtnl locking in rt_secret_reschedule
Message-id: 20090721160959.GF22108@hmsreliant.think-freely.org
O-Subject: [RHEL 5.5 PATCH] net: Fix unbalance rtnl locking in rt_secret_reschedule (bz 510067)
Bugzilla: 510067
RH-Acked-by: David Miller <davem@redhat.com>
RH-Acked-by: Dean Nelson <dnelson@redhat.com>
RH-Acked-by: Andy Gospodarek <gospo@redhat.com>
RH-Acked-by: Jiri Pirko <jpirko@redhat.com>
RH-Acked-by: Thomas Graf <tgraf@redhat.com>

Hey-
	Recently QE found that echoing a zero into
/proc/sys/net/ipv4/route/secret_interval results in a hang on the system.
Looking at it, its clear we have an unbalance locking of the rtnl lock.  I've
just confirmed this patch takes care of the problem.  Fixes bz510067

Neil

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 2e3944e..4e3580a 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -3106,7 +3106,7 @@ static void rt_secret_reschedule(int old)
 	deleted = del_timer_sync(&rt_secret_timer);
 
 	if (!new)
-		return;
+		goto unlock;
 
 	if (deleted) {
 		long time = rt_secret_timer.expires - jiffies;
@@ -3120,6 +3120,7 @@ static void rt_secret_reschedule(int old)
 
 	rt_secret_timer.expires += jiffies;
 	add_timer(&rt_secret_timer);
+unlock:
 	rtnl_unlock();
 }