tunneling: Add missing rcu_dereference() to cache cleaner.
authorJesse Gross <jesse@nicira.com>
Sun, 5 Dec 2010 20:03:49 +0000 (12:03 -0800)
committerJesse Gross <jesse@nicira.com>
Fri, 10 Dec 2010 01:43:36 +0000 (17:43 -0800)
The cleaner for the header caching accesses the tunnel port table
without holding any locks.  However, it doesn't have a read memory
barrier, so there is no guarantee that the contents of the table
have made it to the right CPU.

Found by sparse.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/tunnel.c

index 271651b..aae3f3d 100644 (file)
@@ -818,7 +818,7 @@ static void cache_cleaner(struct work_struct *work)
        schedule_cache_cleaner();
 
        rcu_read_lock();
-       tbl_foreach(port_table, cache_cleaner_cb, NULL);
+       tbl_foreach(rcu_dereference(port_table), cache_cleaner_cb, NULL);
        rcu_read_unlock();
 }