]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: Fix list removal of batadv_hardif_neigh_node
authorSven Eckelmann <sven@narfation.org>
Tue, 5 Jan 2016 11:06:17 +0000 (12:06 +0100)
committerAntonio Quartulli <a@unstable.cc>
Wed, 13 Jan 2016 11:28:27 +0000 (19:28 +0800)
commit19a3b2f59501bcc3fa9da94913c49375559e9ed8
treed6d644c3db05abb5451cd6811f53acd594e9c6be
parentafd20f412da2389607685d43bef7b9a990df40b7
batman-adv: Fix list removal of batadv_hardif_neigh_node

The neigh_list with batadv_hardif_neigh_node objects is accessed with only
rcu_read_lock in batadv_hardif_neigh_get and batadv_iv_neigh_print. Thus it
is not allowed to kfree the object before the rcu grace period ends (which
may still protects context accessing this object). Therefore the object has
first to be removed from the neigh_list and then it has either wait with
synchronize_rcu or call_rcu till the grace period ends before it can be
freed.

Fixes: 70b87cf7eeb3 ("batman-adv: add list of unique single hop neighbors per hard-interface")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
net/batman-adv/originator.c