From: Jesse Gross Date: Sun, 5 Dec 2010 20:03:49 +0000 (-0800) Subject: tunneling: Add missing rcu_dereference() to cache cleaner. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e71f10f38d2ad09ee854b7e926a63744a1883e1;p=openvswitch tunneling: Add missing rcu_dereference() to cache cleaner. 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 Acked-by: Ben Pfaff --- diff --git a/datapath/tunnel.c b/datapath/tunnel.c index 271651bf..aae3f3d9 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -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(); }