]> git.ipfire.org Git - thirdparty/kernel/stable.git/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2016 13:21:20 +0000 (15:21 +0200)
commit2c7398559e770aecaace325ca0f951a4e82318b1
tree221bd0be04a22c5cd73f7b799a172a89016eceb3
parent96e2c6229dc204e6ba92cda06a85c06831525b3a
batman-adv: Add missing refcnt for last_candidate

commit 936523441bb64cdc9a5b263e8fd2782e70313a57 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/batman-adv/routing.c