public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
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 maint v2] batman-adv: Reduce refcnt of removed router when updating route
Date: Sun, 27 Mar 2016 15:51:32 +0800	[thread overview]
Message-ID: <4054492.7ouEHkgyCf@voltaire> (raw)
In-Reply-To: <1458473273-8769-1-git-send-email-sven@narfation.org>

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

On Sunday, March 20, 2016 12:27:53 Sven Eckelmann wrote:
> _batadv_update_route rcu_derefences orig_ifinfo->router outside of a
> spinlock protected region to print some information messages to the debug
> log. But this pointer is not checked again when the new pointer is assigned
> in the spinlock protected region. Thus is can happen that the value of
> orig_ifinfo->router changed in the meantime and thus the reference counter
> of the wrong router gets reduced after the spinlock protected region.
> 
> Just rcu_dereferencing the value of orig_ifinfo->router inside the spinlock
> protected region (which also set the new pointer) is enough to get the
> correct old router object.
> 
> Fixes: d90ddb94423f ("batman-adv: Make orig_node->router an rcu protected
> pointer") Signed-off-by: Sven Eckelmann <sven@narfation.org>
> --
> v2:
>  - add comment explaining the idea behind the extra
> rcu_dereference_protected ---
>  net/batman-adv/routing.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Applied with minor modifications in revision 08ba64d.

Thanks,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

      reply	other threads:[~2016-03-27  7:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-20 11:27 [B.A.T.M.A.N.] [PATCH maint v2] batman-adv: Reduce refcnt of removed router when updating route Sven Eckelmann
2016-03-27  7:51 ` Marek Lindner [this message]

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=4054492.7ouEHkgyCf@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