LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Florian Westphal <fw@strlen.de>,
Steffen Klassert <steffen.klassert@secunet.com>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 4.9 03/13] xfrm: policy: use hlist rcu variants on insert
Date: Tue, 30 Oct 2018 09:29:13 -0400 [thread overview]
Message-ID: <20181030132923.218124-3-sashal@kernel.org> (raw)
In-Reply-To: <20181030132923.218124-1-sashal@kernel.org>
From: Florian Westphal <fw@strlen.de>
[ Upstream commit 9dffff200fd178f11dd50eb1fd8ccd0650c9284e ]
bydst table/list lookups use rcu, so insertions must use rcu versions.
Fixes: a7c44247f704e ("xfrm: policy: make xfrm_policy_lookup_bytype lockless")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/xfrm/xfrm_policy.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index d0dcfc68c043..155b1591b17a 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -659,9 +659,9 @@ static void xfrm_hash_rebuild(struct work_struct *work)
break;
}
if (newpos)
- hlist_add_behind(&policy->bydst, newpos);
+ hlist_add_behind_rcu(&policy->bydst, newpos);
else
- hlist_add_head(&policy->bydst, chain);
+ hlist_add_head_rcu(&policy->bydst, chain);
}
spin_unlock_bh(&net->xfrm.xfrm_policy_lock);
@@ -800,9 +800,9 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
break;
}
if (newpos)
- hlist_add_behind(&policy->bydst, newpos);
+ hlist_add_behind_rcu(&policy->bydst, newpos);
else
- hlist_add_head(&policy->bydst, chain);
+ hlist_add_head_rcu(&policy->bydst, chain);
__xfrm_policy_link(policy, dir);
atomic_inc(&net->xfrm.flow_cache_genid);
--
2.17.1
next prev parent reply other threads:[~2018-10-30 13:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 13:29 [PATCH AUTOSEL 4.9 01/13] bpf: do not blindly change rlimit in reuseport net selftest Sasha Levin
2018-10-30 13:29 ` [PATCH AUTOSEL 4.9 02/13] Revert "perf tools: Fix PMU term format max value calculation" Sasha Levin
2018-10-30 13:29 ` Sasha Levin [this message]
2018-10-30 13:29 ` [PATCH AUTOSEL 4.9 04/13] sparc: Fix single-pcr perf event counter management Sasha Levin
2018-10-30 13:29 ` [PATCH AUTOSEL 4.9 05/13] sparc64: Make proc_id signed Sasha Levin
2018-10-30 13:29 ` [PATCH AUTOSEL 4.9 06/13] sched/fair: Fix the min_vruntime update logic in dequeue_entity() Sasha Levin
2018-10-30 13:29 ` [PATCH AUTOSEL 4.9 07/13] perf cpu_map: Align cpu map synthesized events properly Sasha Levin
2018-10-30 13:29 ` [PATCH AUTOSEL 4.9 08/13] x86/fpu: Remove second definition of fpu in __fpu__restore_sig() Sasha Levin
2018-10-30 13:29 ` [PATCH AUTOSEL 4.9 09/13] net: qla3xxx: Remove overflowing shift statement Sasha Levin
2018-10-30 13:29 ` [PATCH AUTOSEL 4.9 10/13] r8169: fix NAPI handling under high load Sasha Levin
2018-10-30 13:29 ` [PATCH AUTOSEL 4.9 11/13] selftests: ftrace: Add synthetic event syntax testcase Sasha Levin
2018-10-30 13:29 ` [PATCH AUTOSEL 4.9 12/13] net: fix pskb_trim_rcsum_slow() with odd trim offset Sasha Levin
2018-10-30 13:29 ` [PATCH AUTOSEL 4.9 13/13] i2c: rcar: cleanup DMA for all kinds of failure Sasha Levin
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=20181030132923.218124-3-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=fw@strlen.de \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
--subject='Re: [PATCH AUTOSEL 4.9 03/13] xfrm: policy: use hlist rcu variants on insert' \
/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
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).