linux/net/batman-adv
Sven Eckelmann e0011c6c5e batman-adv: Add missing refcnt for last_candidate
commit 936523441b 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: f3b3d90189 ("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>
[bwh: Backported to 3.16:
 - s/kref_get/atomic_inc/
 - s/_put/_free_ref/]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2016-11-20 01:17:18 +00:00
..
bat_algo.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
bat_iv_ogm.c batman-adv: Fix integer overflow in batadv_iv_ogm_calc_tq 2016-08-22 22:38:02 +01:00
bitarray.c batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
bitarray.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
bridge_loop_avoidance.c batman-adv: Fix non-atomic bla_claim::backbone_gw access 2016-11-20 01:16:45 +00:00
bridge_loop_avoidance.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
debugfs.c batman-adv: remove semi-colon after macro definition 2014-05-18 15:04:00 +02:00
debugfs.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
distributed-arp-table.c batman-adv: Avoid nullptr dereference in dat after vlan_insert_tag 2016-11-20 01:16:44 +00:00
distributed-arp-table.h batman-adv: improve DAT documentation 2014-03-22 09:18:59 +01:00
fragmentation.c batman-adv: Unify fragment size calculation 2015-01-19 11:20:46 +00:00
fragmentation.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
gateway_client.c batman-adv: avoid NULL dereferences and fix if check 2015-01-19 11:21:16 +00:00
gateway_client.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
gateway_common.c batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
gateway_common.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
hard-interface.c batman: fix a bogus warning from batadv_is_on_batman_iface() 2014-05-22 17:23:00 -04:00
hard-interface.h batman-adv: Drop immediate batadv_hard_iface free function 2016-02-03 00:01:12 +00:00
hash.c batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
hash.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
icmp_socket.c batman-adv: prefer ether_addr_copy to memcpy 2014-03-22 08:50:26 +01:00
icmp_socket.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
Kconfig batman-adv: Multicast Listener Announcements via Translation Table 2014-03-22 09:18:56 +01:00
main.c batman-adv: Send multicast packets to nodes with a WANT_ALL flag 2014-03-22 09:18:58 +01:00
main.h batman-adv: Start new development cycle 2014-05-18 15:04:00 +02:00
Makefile batman-adv: Multicast Listener Announcements via Translation Table 2014-03-22 09:18:56 +01:00
multicast.c batman-adv: Fix potential synchronization issues in mcast tvlv handler 2015-09-30 13:20:43 +01:00
multicast.h batman-adv: Modified forwarding behaviour for multicast packets 2014-03-22 09:18:57 +01:00
network-coding.c batman-adv: Avoid recursive call_rcu for batadv_nc_node 2016-02-02 23:49:14 +00:00
network-coding.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
originator.c batman-adv: Free last_bonding_candidate on release of orig_node 2016-11-20 01:16:45 +00:00
originator.h batman-adv: Drop immediate orig_node free function 2016-02-03 00:02:01 +00:00
packet.h batman-adv: improve the TT flags documentation 2014-03-22 09:18:59 +01:00
routing.c batman-adv: Add missing refcnt for last_candidate 2016-11-20 01:17:18 +00:00
routing.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
send.c batman-adv: Fix speedy join in gateway client mode 2016-11-20 01:16:46 +00:00
send.h batman-adv: Modified forwarding behaviour for multicast packets 2014-03-22 09:18:57 +01:00
soft-interface.c batman-adv: Clean up untagged vlan when destroying via rtnl-link 2016-08-22 22:38:24 +01:00
soft-interface.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
sysfs.c batman-adv: remove semi-colon after macro definition 2014-05-18 15:04:00 +02:00
sysfs.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
translation-table.c batman-adv: Fix double-put of vlan object 2016-08-22 22:38:24 +01:00
translation-table.h batman-adv: Modified forwarding behaviour for multicast packets 2014-03-22 09:18:57 +01:00
types.h batman-adv: Fix reference leak in batadv_find_router 2016-11-20 01:16:45 +00:00