public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <a@unstable.cc>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix reference counting of vlan object for tt_local_entry
Date: Thu, 21 Apr 2016 18:22:52 +0800	[thread overview]
Message-ID: <20160421102252.GB23886@prodigo> (raw)
In-Reply-To: <1457711046-4603-1-git-send-email-sven@narfation.org>

[-- Attachment #1: Type: text/plain, Size: 1362 bytes --]

On Fri, Mar 11, 2016 at 04:44:05PM +0100, Sven Eckelmann wrote:
> The batadv_tt_local_entry was specific to a batadv_softif_vlan and held an
> implicit reference to it. But this reference was never stored in form of a
> pointer in the tt_local_entry itself. Instead batadv_tt_local_remove,
> batadv_tt_local_table_free and batadv_tt_local_purge_pending_clients depend
> on a consistent state of bat_priv->softif_vlan_list and that
> batadv_softif_vlan_get always returns the batadv_softif_vlan object which
> it has a reference for. But batadv_softif_vlan_get cannot guarantee that
> because it is working only with rcu_read_lock on this list. It can
> therefore happen that an vid is in this list twice or that
> batadv_softif_vlan_get cannot find the batadv_softif_vlan for an vid due to
> some other list operations taking place at the same time.
> 
> Instead add a batadv_softif_vlan pointer directly in batadv_tt_local_entry
> which will be used for the reference counter decremented on release of
> batadv_tt_local_entry.
> 
> Fixes: 9729d2085c0f ("batman-adv: fix TT VLAN inconsistency on VLAN re-add")
> Signed-off-by: Sven Eckelmann <sven@narfation.org>

Thanks a lot Sven ! This change, on top of fixing the ref issue, also simplified
the code quite a lot!

Acked-by: Antonio Quartulli <a@unstable.cc>

-- 
Antonio Quartulli

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2016-04-21 10:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 15:44 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix reference counting of vlan object for tt_local_entry Sven Eckelmann
2016-03-11 15:44 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix reference counting of hardif_neigh_node object for neigh_node Sven Eckelmann
2016-04-21 10:44   ` Marek Lindner
2016-04-21 10:22 ` Antonio Quartulli [this message]
2016-04-21 10:40   ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix reference counting of vlan object for tt_local_entry Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160421102252.GB23886@prodigo \
    --to=a@unstable.cc \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox