From: Marek Lindner <mareklindner@neomailbox.ch>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix reference counting of hardif_neigh_node object for neigh_node
Date: Thu, 21 Apr 2016 18:44:32 +0800 [thread overview]
Message-ID: <3220028.GBF7ojiHLr@voltaire> (raw)
In-Reply-To: <1457711046-4603-2-git-send-email-sven@narfation.org>
[-- Attachment #1: Type: text/plain, Size: 1454 bytes --]
On Friday, March 11, 2016 16:44:06 Sven Eckelmann wrote:
> The batadv_neigh_node was specific to a batadv_hardif_neigh_node and held
> an implicit reference to it. But this reference was never stored in form of
> a pointer in the batadv_neigh_node itself. Instead
> batadv_neigh_node_release depends on a consistent state of
> hard_iface->neigh_list and that batadv_hardif_neigh_get always returns the
> batadv_hardif_neigh_node object which it has a reference for. But
> batadv_hardif_neigh_get cannot guarantee that because it is working only
> with rcu_read_lock on this list. It can therefore happen that a neigh_addr
> is in this list twice or that batadv_hardif_neigh_get cannot find the
> batadv_hardif_neigh_node for an neigh_addr due to some other list
> operations taking place at the same time.
>
> Instead add a batadv_hardif_neigh_node pointer directly in
> batadv_neigh_node which will be used for the reference counter decremented
> on release of batadv_neigh_node.
>
> Fixes: fed2826b490c ("batman-adv: add list of unique single hop neighbors
> per hard-interface") Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> See https://www.open-mesh.org/issues/242
>
> v1:
> - Remove the old code blocks
> - make the _put unconditional
> ---
> net/batman-adv/originator.c | 16 +++++-----------
> net/batman-adv/types.h | 2 ++
> 2 files changed, 7 insertions(+), 11 deletions(-)
Applied in revision a198a23.
Thanks,
Marek
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-04-21 10:44 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 [this message]
2016-04-21 10:22 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix reference counting of vlan object for tt_local_entry Antonio Quartulli
2016-04-21 10:40 ` 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=3220028.GBF7ojiHLr@voltaire \
--to=mareklindner@neomailbox.ch \
--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