[ovs-dev] [PATCH 14/19] tunneling: Add missing rcu_dereference() to cache cleaner.
Jesse Gross
jesse at nicira.com
Thu Dec 9 06:14:12 UTC 2010
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 at nicira.com>
---
datapath/tunnel.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/datapath/tunnel.c b/datapath/tunnel.c
index f5afe0b..58caa61 100644
--- a/datapath/tunnel.c
+++ b/datapath/tunnel.c
@@ -810,7 +810,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();
}
--
1.7.1
More information about the dev
mailing list