netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: steffen.klassert@secunet.com
Cc: xiyou.wangcong@gmail.com, <netdev@vger.kernel.org>,
	Florian Westphal <fw@strlen.de>
Subject: [PATCH ipsec 2/7] xfrm: policy: use hlist rcu variants on inexact insert, part 2
Date: Fri,  4 Jan 2019 14:17:00 +0100	[thread overview]
Message-ID: <20190104131705.9550-3-fw@strlen.de> (raw)
In-Reply-To: <20190104131705.9550-1-fw@strlen.de>

This function was modeled on the 'exact' insert one, which did not use
the rcu variant either.

When I fixed the 'exact' insert I forgot to propagate this to my
development tree, so the inexact variant retained the bug.

Fixes: 9cf545ebd591d ("xfrm: policy: store inexact policies in a tree ordered by destination address")
Signed-off-by: Florian Westphal <fw@strlen.de>
---
 net/xfrm/xfrm_policy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 934492bad8e0..628b389af2ba 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -856,9 +856,9 @@ static void xfrm_policy_inexact_list_reinsert(struct net *net,
 		}
 
 		if (newpos)
-			hlist_add_behind(&policy->bydst, newpos);
+			hlist_add_behind_rcu(&policy->bydst, newpos);
 		else
-			hlist_add_head(&policy->bydst, &n->hhead);
+			hlist_add_head_rcu(&policy->bydst, &n->hhead);
 
 		/* paranoia checks follow.
 		 * Check that the reinserted policy matches at least
-- 
2.19.2

  parent reply	other threads:[~2019-01-04 13:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-04 13:16 [PATCH ipsec 0/7] xfrm: policy: fix various bugs Florian Westphal
2019-01-04 13:16 ` [PATCH ipsec 1/7] selftests: xfrm: add block rules with adjacent/overlapping subnets Florian Westphal
2019-01-04 13:17 ` Florian Westphal [this message]
2019-01-04 13:17 ` [PATCH ipsec 3/7] xfrm: policy: increment xfrm_hash_generation on hash rebuild Florian Westphal
2019-01-04 13:17 ` [PATCH ipsec 4/7] xfrm: policy: delete inexact policies from inexact list " Florian Westphal
2019-01-05  4:46   ` Cong Wang
2019-01-05  9:53     ` Florian Westphal
2019-01-04 13:17 ` [PATCH ipsec 5/7] xfrm: policy: fix reinsertion on node merge Florian Westphal
2019-01-05  4:48   ` Cong Wang
2019-01-05  9:57     ` Florian Westphal
2019-01-04 13:17 ` [PATCH ipsec 6/7] selftests: xfrm: alter htresh to trigger move of policies to hash table Florian Westphal
2019-01-04 13:17 ` [PATCH ipsec 7/7] xfrm: policy: fix infinite loop when merging src-nodes Florian Westphal
2019-01-05  4:49   ` Cong Wang
2019-01-05  9:59     ` Florian Westphal
2019-01-09 13:03       ` Steffen Klassert
2019-01-10  8:09 ` [PATCH ipsec 0/7] xfrm: policy: fix various bugs Steffen Klassert

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=20190104131705.9550-3-fw@strlen.de \
    --to=fw@strlen.de \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    --cc=xiyou.wangcong@gmail.com \
    /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).