From: Eric Dumazet Date: Thu, 16 Oct 2008 21:18:29 +0000 (-0700) Subject: ipv4: Add a missing rcu_assign_pointer() in routing cache. X-Git-Tag: v2.6.28-rc1~264^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=00269b54edbf25f3bb0dccb558ae23a6fc77ed86;p=linux-2.6-omap-h63xx.git ipv4: Add a missing rcu_assign_pointer() in routing cache. rt_intern_hash() is doing an update of a RCU guarded hash chain without using rcu_assign_pointer() or equivalent barrier. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/ipv4/route.c b/net/ipv4/route.c index a6d7c584f53..8d23cc7efba 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -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;