Repository : ssh://git@open-mesh.org/batman-adv
On branch : maint
commit 7ad001a18d1a6e2fd19969fdd671efe99d75920f Author: Sven Eckelmann sven@narfation.org Date: Fri Jul 17 10:03:43 2015 +0200
batman-adv: Avoid crashing kernel with multicast asserts
The BUG_ON added to the multicast code in commit 7f220ed1f063 ("batman-adv: Fix potential synchronization issues in mcast tvlv handler") will crash the kernel when the statement is true. This is not strictly required and a WARN_ON is enough to raise attention.
Signed-off-by: Sven Eckelmann sven@narfation.org Acked-by: Linus Lüssing linus.luessing@c0d3.blue Signed-off-by: Marek Lindner mareklindner@neomailbox.ch
7ad001a18d1a6e2fd19969fdd671efe99d75920f multicast.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/multicast.c b/multicast.c index ee8317f..417c3fa 100644 --- a/multicast.c +++ b/multicast.c @@ -582,7 +582,7 @@ static void batadv_mcast_want_unsnoop_update(struct batadv_priv *bat_priv,
spin_lock_bh(&bat_priv->mcast.want_lists_lock); /* flag checks above + mcast_handler_lock prevents this */ - BUG_ON(!hlist_unhashed(node)); + WARN_ON(!hlist_unhashed(node));
hlist_add_head_rcu(node, head); spin_unlock_bh(&bat_priv->mcast.want_lists_lock); @@ -593,7 +593,7 @@ static void batadv_mcast_want_unsnoop_update(struct batadv_priv *bat_priv,
spin_lock_bh(&bat_priv->mcast.want_lists_lock); /* flag checks above + mcast_handler_lock prevents this */ - BUG_ON(hlist_unhashed(node)); + WARN_ON(hlist_unhashed(node));
hlist_del_init_rcu(node); spin_unlock_bh(&bat_priv->mcast.want_lists_lock); @@ -625,7 +625,7 @@ static void batadv_mcast_want_ipv4_update(struct batadv_priv *bat_priv,
spin_lock_bh(&bat_priv->mcast.want_lists_lock); /* flag checks above + mcast_handler_lock prevents this */ - BUG_ON(!hlist_unhashed(node)); + WARN_ON(!hlist_unhashed(node));
hlist_add_head_rcu(node, head); spin_unlock_bh(&bat_priv->mcast.want_lists_lock); @@ -636,7 +636,7 @@ static void batadv_mcast_want_ipv4_update(struct batadv_priv *bat_priv,
spin_lock_bh(&bat_priv->mcast.want_lists_lock); /* flag checks above + mcast_handler_lock prevents this */ - BUG_ON(hlist_unhashed(node)); + WARN_ON(hlist_unhashed(node));
hlist_del_init_rcu(node); spin_unlock_bh(&bat_priv->mcast.want_lists_lock); @@ -668,7 +668,7 @@ static void batadv_mcast_want_ipv6_update(struct batadv_priv *bat_priv,
spin_lock_bh(&bat_priv->mcast.want_lists_lock); /* flag checks above + mcast_handler_lock prevents this */ - BUG_ON(!hlist_unhashed(node)); + WARN_ON(!hlist_unhashed(node));
hlist_add_head_rcu(node, head); spin_unlock_bh(&bat_priv->mcast.want_lists_lock); @@ -679,7 +679,7 @@ static void batadv_mcast_want_ipv6_update(struct batadv_priv *bat_priv,
spin_lock_bh(&bat_priv->mcast.want_lists_lock); /* flag checks above + mcast_handler_lock prevents this */ - BUG_ON(hlist_unhashed(node)); + WARN_ON(hlist_unhashed(node));
hlist_del_init_rcu(node); spin_unlock_bh(&bat_priv->mcast.want_lists_lock);