Re: [B.A.T.M.A.N.] [PATCH v2 01/30] batman-adv: Fix list removal of batadv_hardif_neigh_node

Linus Lüssing
2016-01-04T16:03:02Z

On Sun, Dec 20, 2015 at 02:17:41PM +0100, Sven Eckelmann wrote:
> The neigh_list with batadv_hardif_neigh_node objects is accessed with only
> rcu_read_lock in batadv_neigh_node_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.

Urgh, could catch, that's a nasty one! Should be put into maint at
least thrice ;).

Nit: I think you mean "batadv_hardif_neigh_get" instead of
"batadv_neigh_node_get" in the commit message?