aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/types.h
diff options
context:
space:
mode:
authorLinus Lüssing <linus.luessing@ascom.ch>2011-02-13 21:13:02 +0000
committerMarek Lindner <lindner_marek@yahoo.de>2011-03-05 12:50:10 +0100
commit5d02b3cdfafeb23ab7cf43ef1d2118007370e8d0 (patch)
tree4bd28fe2a1bca0a14710f01f98852f43ef2e330c /net/batman-adv/types.h
parentf3e0008f01b275bd08bd416cfcaa7021dd6bc277 (diff)
downloadkernel_samsung_smdk4412-5d02b3cdfafeb23ab7cf43ef1d2118007370e8d0.zip
kernel_samsung_smdk4412-5d02b3cdfafeb23ab7cf43ef1d2118007370e8d0.tar.gz
kernel_samsung_smdk4412-5d02b3cdfafeb23ab7cf43ef1d2118007370e8d0.tar.bz2
batman-adv: Make bat_priv->curr_gw an rcu protected pointer
The rcu protected macros rcu_dereference() and rcu_assign_pointer() for the bat_priv->curr_gw need to be used, as well as spin/rcu locking. Otherwise we might end up using a curr_gw pointer pointing to already freed memory. Reported-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Linus Lüssing <linus.luessing@ascom.ch> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/types.h')
-rw-r--r--net/batman-adv/types.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index e1f3e5e..3dd5e77 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -162,7 +162,7 @@ struct bat_priv {
spinlock_t forw_bcast_list_lock; /* protects */
spinlock_t hna_lhash_lock; /* protects hna_local_hash */
spinlock_t hna_ghash_lock; /* protects hna_global_hash */
- spinlock_t gw_list_lock; /* protects gw_list */
+ spinlock_t gw_list_lock; /* protects gw_list and curr_gw */
spinlock_t vis_hash_lock; /* protects vis_hash */
spinlock_t vis_list_lock; /* protects vis_info::recv_list */
spinlock_t softif_neigh_lock; /* protects soft-interface neigh list */
@@ -171,7 +171,7 @@ struct bat_priv {
struct delayed_work hna_work;
struct delayed_work orig_work;
struct delayed_work vis_work;
- struct gw_node *curr_gw;
+ struct gw_node __rcu *curr_gw; /* rcu protected pointer */
struct vis_info *my_vis_info;
};