mac80211: fix a buffer overrun in station debug code
[pandora-kernel.git] / net / ipv4 / route.c
index a6d7c58..2ea6dcc 100644 (file)
@@ -1109,7 +1109,12 @@ restart:
                printk("\n");
        }
 #endif
-       rt_hash_table[hash].chain = rt;
+       /*
+        * Since lookup is lockfree, we must make sure
+        * previous writes to rt are comitted to memory
+        * before making rt visible to other CPUS.
+        */
+       rcu_assign_pointer(rt_hash_table[hash].chain, rt);
        spin_unlock_bh(rt_hash_lock_addr(hash));
        *rp = rt;
        return 0;
@@ -2908,8 +2913,6 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write,
 }
 
 static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table,
-                                               int __user *name,
-                                               int nlen,
                                                void __user *oldval,
                                                size_t __user *oldlenp,
                                                void __user *newval,
@@ -2972,16 +2975,13 @@ static int ipv4_sysctl_rt_secret_interval(ctl_table *ctl, int write,
 }
 
 static int ipv4_sysctl_rt_secret_interval_strategy(ctl_table *table,
-                                                  int __user *name,
-                                                  int nlen,
                                                   void __user *oldval,
                                                   size_t __user *oldlenp,
                                                   void __user *newval,
                                                   size_t newlen)
 {
        int old = ip_rt_secret_interval;
-       int ret = sysctl_jiffies(table, name, nlen, oldval, oldlenp, newval,
-                                newlen);
+       int ret = sysctl_jiffies(table, oldval, oldlenp, newval, newlen);
 
        rt_secret_reschedule(old);