From d0709a65181beb787ef3f58cfe45536a2bb254c8 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Mon, 25 Feb 2008 16:27:46 +0100 Subject: mac80211: RCU-ify STA info structure access This makes access to the STA hash table/list use RCU to protect against freeing of items. However, it's not a true RCU, the copy step is missing: whenever somebody changes a STA item it is simply updated. This is an existing race condition that is now somewhat understandable. This patch also fixes the race key freeing vs. STA destruction by making sure that sta_info_destroy() is always called under RTNL and frees the key. Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- net/mac80211/mesh_hwmp.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'net/mac80211/mesh_hwmp.c') diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index c2f40ef418c..d8530fe7a0b 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -294,7 +294,6 @@ static u32 hwmp_route_info_get(struct net_device *dev, orig_metric = PREP_IE_METRIC(hwmp_ie); break; default: - sta_info_put(sta); rcu_read_unlock(); return 0; } @@ -330,7 +329,6 @@ static u32 hwmp_route_info_get(struct net_device *dev, mpath = mesh_path_lookup(orig_addr, dev); if (!mpath) { rcu_read_unlock(); - sta_info_put(sta); return 0; } spin_lock_bh(&mpath->state_lock); @@ -372,7 +370,6 @@ static u32 hwmp_route_info_get(struct net_device *dev, mpath = mesh_path_lookup(ta, dev); if (!mpath) { rcu_read_unlock(); - sta_info_put(sta); return 0; } spin_lock_bh(&mpath->state_lock); @@ -391,7 +388,6 @@ static u32 hwmp_route_info_get(struct net_device *dev, spin_unlock_bh(&mpath->state_lock); } - sta_info_put(sta); rcu_read_unlock(); return process ? new_metric : 0; @@ -861,5 +857,5 @@ void mesh_path_timer(unsigned long data) endmpathtimer: rcu_read_unlock(); if (delete) - mesh_path_del(mpath->dst, mpath->dev); + mesh_path_del(mpath->dst, mpath->dev, false); } -- cgit v1.2.3