]> git.itanic.dy.fi Git - linux-stable/commit
batman-adv: Add missing refcnt for last_candidate
authorSven Eckelmann <sven@narfation.org>
Sat, 6 Aug 2016 13:50:52 +0000 (15:50 +0200)
committerSimon Wunderlich <sw@simonwunderlich.de>
Fri, 26 Aug 2016 13:22:30 +0000 (15:22 +0200)
commit936523441bb64cdc9a5b263e8fd2782e70313a57
treedcc21b6097509844be06b692a15f6c3f0128497f
parent1fe323aa1b2390a0c57fb0b06a782f128d49094c
batman-adv: Add missing refcnt for last_candidate

batadv_find_router dereferences last_bonding_candidate from
orig_node without making sure that it has a valid reference. This reference
has to be retrieved by increasing the reference counter while holding
neigh_list_lock. The lock is required to avoid that
batadv_last_bonding_replace removes the current last_bonding_candidate,
reduces the reference counter and maybe destroys the object in this
process.

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>
net/batman-adv/routing.c