netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ying Xue <ying.xue@windriver.com>
To: <netdev@vger.kernel.org>
Cc: <eric.dumazet@gmail.com>
Subject: [PATCH net-next] neigh: Add missing rcu_assign_pointer
Date: Thu, 28 May 2015 16:28:20 +0800	[thread overview]
Message-ID: <1432801700-29300-1-git-send-email-ying.xue@windriver.com> (raw)

Commit e4c4e448cf55 ("neigh: Convert garbage collection from softirq
to workqueue") misses to use rcu_assign_pointer() macro to assign a
RCU-protected pointer.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
---
 net/core/neighbour.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 3a74df7..aaad3a5 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -783,7 +783,8 @@ static void neigh_periodic_work(struct work_struct *work)
 			if (atomic_read(&n->refcnt) == 1 &&
 			    (state == NUD_FAILED ||
 			     time_after(jiffies, n->used + NEIGH_VAR(n->parms, GC_STALETIME)))) {
-				*np = n->next;
+				rcu_assign_pointer(*np, rcu_dereference_protected(n->next,
+								lockdep_is_held(&tbl->lock)));
 				n->dead = 1;
 				write_unlock(&n->lock);
 				neigh_cleanup_and_release(n);
-- 
1.7.9.5

             reply	other threads:[~2015-05-28  8:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28  8:28 Ying Xue [this message]
2015-05-28 10:13 ` [PATCH net-next] neigh: Add missing rcu_assign_pointer Eric Dumazet
2015-05-28 13:50   ` Herbert Xu
2015-05-28 14:38     ` Eric Dumazet
2015-05-29  0:24       ` Herbert Xu
2015-05-29  1:21   ` Ying Xue
2015-05-29  1:50     ` Eric Dumazet
2015-05-29  2:04       ` Ying Xue

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=1432801700-29300-1-git-send-email-ying.xue@windriver.com \
    --to=ying.xue@windriver.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).