summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/types.h
diff options
context:
space:
mode:
authorSven Eckelmann2016-06-30 20:11:34 +0200
committerSimon Wunderlich2016-07-05 12:43:52 +0200
commit15c2ed753cd9e3e746472deab8151337a5b6da56 (patch)
treeb078f6d4b1f139c456e2643461dc24699a5b92b3 /net/batman-adv/types.h
parentbatman-adv: Fix non-atomic bla_claim::backbone_gw access (diff)
downloadkernel-qcow2-linux-15c2ed753cd9e3e746472deab8151337a5b6da56.tar.gz
kernel-qcow2-linux-15c2ed753cd9e3e746472deab8151337a5b6da56.tar.xz
kernel-qcow2-linux-15c2ed753cd9e3e746472deab8151337a5b6da56.zip
batman-adv: Fix reference leak in batadv_find_router
The replacement of last_bonding_candidate in batadv_orig_node has to be an atomic operation. Otherwise it is possible that the reference counter of a batadv_orig_ifinfo is reduced which was no longer the last_bonding_candidate when the new candidate is added. This can either lead to an invalid memory access or to reference leaks which make it impossible to an interface which was added to batman-adv. Fixes: f3b3d9018975 ("batman-adv: add bonding again") Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/types.h')
-rw-r--r--net/batman-adv/types.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 005122234b90..74d865a4df46 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -330,7 +330,9 @@ struct batadv_orig_node {
DECLARE_BITMAP(bcast_bits, BATADV_TQ_LOCAL_WINDOW_SIZE);
u32 last_bcast_seqno;
struct hlist_head neigh_list;
- /* neigh_list_lock protects: neigh_list and router */
+ /* neigh_list_lock protects: neigh_list, ifinfo_list,
+ * last_bonding_candidate and router
+ */
spinlock_t neigh_list_lock;
struct hlist_node hash_entry;
struct batadv_priv *bat_priv;