]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: Fix reference leak in batadv_find_router
authorSven Eckelmann <sven@narfation.org>
Thu, 30 Jun 2016 18:11:34 +0000 (20:11 +0200)
committerSimon Wunderlich <sw@simonwunderlich.de>
Tue, 5 Jul 2016 10:43:52 +0000 (12:43 +0200)
commit507a719d7f0235b2aec20344c1b762d87610c3ff
treeb078f6d4b1f139c456e2643461dc24699a5b92b3
parent04d76066977e038cbdd20bf1c4cedd66d3c031be
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: 6656bc99841d ("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
net/batman-adv/types.h