1
0
Fork 0
remarkable-linux/net/batman-adv
Sven Eckelmann b55c212a0f batman-adv: Reduce refcnt of removed router when updating route
[ Upstream commit d1a65f1741 ]

_batadv_update_route rcu_derefences orig_ifinfo->router outside of a
spinlock protected region to print some information messages to the debug
log. But this pointer is not checked again when the new pointer is assigned
in the spinlock protected region. Thus is can happen that the value of
orig_ifinfo->router changed in the meantime and thus the reference counter
of the wrong router gets reduced after the spinlock protected region.

Just rcu_dereferencing the value of orig_ifinfo->router inside the spinlock
protected region (which also set the new pointer) is enough to get the
correct old router object.

Fixes: e1a5382f97 ("batman-adv: Make orig_node->router an rcu protected pointer")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2016-07-10 23:07:19 -04:00
..
Kconfig batman-adv: Kconfig, Add missing DEBUG_FS dependency 2015-01-07 22:17:11 +01:00
Makefile batman-adv: Multicast Listener Announcements via Translation Table 2014-03-22 09:18:56 +01: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: checkpatch - remove unnecessary parentheses 2015-01-07 17:21:56 +01:00
bitarray.c batman-adv: checkpatch - Please don't use multiple blank lines 2015-01-07 17:21:56 +01:00
bitarray.h batman-adv: checkpatch - else is not generally useful after a break or return 2015-01-07 17:21:55 +01:00
bridge_loop_avoidance.c batman-adv: Avoid recursive call_rcu for batadv_bla_claim 2016-01-31 11:23:37 -08:00
bridge_loop_avoidance.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
debugfs.c batman-adv: checkpatch - Please use a blank line after declarations 2015-01-07 17:21:55 +01:00
debugfs.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
distributed-arp-table.c batman-adv: Make DAT capability changes atomic 2015-10-22 14:43:21 -07:00
distributed-arp-table.h batman-adv: kernel doc fix for distributed-arp-table.h 2015-01-07 17:21:54 +01:00
fragmentation.c batman-adv: checkpatch - Please don't use multiple blank lines 2015-01-07 17:21:56 +01:00
fragmentation.h batman-adv: checkpatch - else is not generally useful after a break or return 2015-01-07 17:21:55 +01:00
gateway_client.c batman-adv: Fix use of seq_has_overflowed() 2015-02-22 17:00:08 -05:00
gateway_client.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
gateway_common.c batman-adv: replace strnicmp with strncasecmp 2014-10-14 02:18:24 +02:00
gateway_common.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
hard-interface.c dev: introduce dev_get_iflink() 2015-04-02 14:04:59 -04:00
hard-interface.h batman-adv: Drop immediate batadv_hard_iface free function 2016-01-31 11:23:37 -08:00
hash.c batman-adv: prefer kmalloc_array to kmalloc when possible 2014-08-04 16:02:10 +02: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
main.c batman-adv: fix misspelled words 2015-01-07 17:21:57 +01:00
main.h batman-adv: Start new development cycle 2015-01-07 17:21:58 +01:00
multicast.c batman-adv: Fix potential synchronization issues in mcast tvlv handler 2015-10-22 14:43:24 -07:00
multicast.h batman-adv: avoid useless return in void functions 2015-01-07 17:21:52 +01:00
network-coding.c batman-adv: Avoid recursive call_rcu for batadv_nc_node 2016-01-31 11:23:37 -08:00
network-coding.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
originator.c batman-adv: Drop immediate orig_node free function 2016-01-31 11:23:38 -08:00
originator.h batman-adv: Drop immediate orig_node free function 2016-01-31 11:23:38 -08:00
packet.h batman-adv: fix misspelled words 2015-01-07 17:21:57 +01:00
routing.c batman-adv: Reduce refcnt of removed router when updating route 2016-07-10 23:07:19 -04:00
routing.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
send.c batman-adv: Fix broadcast/ogm queue limit on a removed interface 2016-07-10 23:07:19 -04:00
send.h batman-adv: Modified forwarding behaviour for multicast packets 2014-03-22 09:18:57 +01:00
soft-interface.c batman-adv: Check skb size before using encapsulated ETH+VLAN header 2016-07-10 23:07:19 -04:00
soft-interface.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
sysfs.c batman-adv: checkpatch - Please don't use multiple blank lines 2015-01-07 17:21:56 +01:00
sysfs.h batman-adv: update copyright years for 2014 2014-01-12 14:41:19 +01:00
translation-table.c batman-adv: Drop immediate orig_node free function 2016-01-31 11:23:38 -08: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 potential synchronization issues in mcast tvlv handler 2015-10-22 14:43:24 -07:00