linux/net/batman-adv
Linus Lüssing 8a4023c5b5 batman-adv: Fix potential synchronization issues in mcast tvlv handler
So far the mcast tvlv handler did not anticipate the processing of
multiple incoming OGMs from the same originator at the same time. This
can lead to various issues:

* Broken refcounting: For instance two mcast handlers might both assume
  that an originator just got multicast capabilities and will together
  wrongly decrease mcast.num_disabled by two, potentially leading to
  an integer underflow.

* Potential kernel panic on hlist_del_rcu(): Two mcast handlers might
  one after another try to do an
  hlist_del_rcu(&orig->mcast_want_all_*_node). The second one will
  cause memory corruption / crashes.
  (Reported by: Sven Eckelmann <sven@narfation.org>)

Right in the beginning the code path makes assumptions about the current
multicast related state of an originator and bases all updates on that. The
easiest and least error prune way to fix the issues in this case is to
serialize multiple mcast handler invocations with a spinlock.

Fixes: 60432d756c ("batman-adv: Announce new capability via multicast TVLV")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
2015-08-14 22:52:08 +02:00
..
bat_algo.h batman-adv: update copyright years for 2015 2015-05-29 10:13:35 +02:00
bat_iv_ogm.c batman-adv: Clarify calculation precedence for '&' and '?' 2015-06-07 17:07:19 +02:00
bitarray.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
bitarray.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
bridge_loop_avoidance.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
bridge_loop_avoidance.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
debugfs.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
debugfs.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
distributed-arp-table.c batman-adv: Make DAT capability changes atomic 2015-08-14 22:50:42 +02:00
distributed-arp-table.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
fragmentation.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
fragmentation.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
gateway_client.c batman-adv: Avoid u32 overflow during gateway select 2015-08-11 18:10:04 +02:00
gateway_client.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
gateway_common.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
gateway_common.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
hard-interface.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
hard-interface.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
hash.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
hash.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
icmp_socket.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
icmp_socket.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
Kconfig batman-adv: Kconfig, Add missing DEBUG_FS dependency 2015-01-07 22:17:11 +01:00
main.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
main.h batman-adv: Clarify calculation precedence for '&' and '?' 2015-06-07 17:07:19 +02:00
Makefile batman-adv: Makefile, Sort alphabetically 2015-05-29 10:13:36 +02:00
multicast.c batman-adv: Fix potential synchronization issues in mcast tvlv handler 2015-08-14 22:52:08 +02:00
multicast.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
network-coding.c batman-adv: Make NC capability changes atomic 2015-08-14 22:50:43 +02:00
network-coding.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
originator.c batman-adv: Fix potential synchronization issues in mcast tvlv handler 2015-08-14 22:52:08 +02:00
originator.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
packet.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
routing.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
routing.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
send.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
send.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
soft-interface.c batman-adv: change the MAC of each VLAN upon ndo_set_mac_address 2015-06-07 17:07:20 +02:00
soft-interface.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
sysfs.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
sysfs.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
translation-table.c batman-adv: Make TT capability changes atomic 2015-08-14 22:50:43 +02:00
translation-table.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
types.h batman-adv: Fix potential synchronization issues in mcast tvlv handler 2015-08-14 22:52:08 +02:00