]> git.itanic.dy.fi Git - linux-stable/commit
batman-adv: protect tt_local_entry from concurrent delete events
authorMarek Lindner <mareklindner@neomailbox.ch>
Wed, 17 Jun 2015 12:01:36 +0000 (20:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Oct 2015 21:43:20 +0000 (14:43 -0700)
commit103c584bcde170c3035041d85e79a90eae177eaf
tree5d4c1475abd10b6e75dbed4e6753b1716f64636d
parentb046d646f1cbe1453b4ae63dc749e62f6e01c9c7
batman-adv: protect tt_local_entry from concurrent delete events

commit ef72706a0543d0c3a5ab29bd6378fdfb368118d9 upstream.

The tt_local_entry deletion performed in batadv_tt_local_remove() was neither
protecting against simultaneous deletes nor checking whether the element was
still part of the list before calling hlist_del_rcu().

Replacing the hlist_del_rcu() call with batadv_hash_remove() provides adequate
protection via hash spinlocks as well as an is-element-still-in-hash check to
avoid 'blind' hash removal.

Fixes: 068ee6e204e1 ("batman-adv: roaming handling mechanism redesign")
Reported-by: alfonsname@web.de
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/batman-adv/translation-table.c