diff options
author | Florian Westphal <fw@strlen.de> | 2018-10-10 12:02:21 -0400 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2018-10-11 07:24:46 -0400 |
commit | 9dffff200fd178f11dd50eb1fd8ccd0650c9284e (patch) | |
tree | a9549d86def6aba71a3230e82e21edb9e77e894d | |
parent | 9f7e43da6ae4862b48bac233838ba808c1167a0d (diff) |
xfrm: policy: use hlist rcu variants on insert
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>
-rw-r--r-- | net/xfrm/xfrm_policy.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index f094d4b3520d..119a427d9b2b 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -632,9 +632,9 @@ static void xfrm_hash_rebuild(struct work_struct *work) | |||
632 | break; | 632 | break; |
633 | } | 633 | } |
634 | if (newpos) | 634 | if (newpos) |
635 | hlist_add_behind(&policy->bydst, newpos); | 635 | hlist_add_behind_rcu(&policy->bydst, newpos); |
636 | else | 636 | else |
637 | hlist_add_head(&policy->bydst, chain); | 637 | hlist_add_head_rcu(&policy->bydst, chain); |
638 | } | 638 | } |
639 | 639 | ||
640 | spin_unlock_bh(&net->xfrm.xfrm_policy_lock); | 640 | spin_unlock_bh(&net->xfrm.xfrm_policy_lock); |
@@ -774,9 +774,9 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) | |||
774 | break; | 774 | break; |
775 | } | 775 | } |
776 | if (newpos) | 776 | if (newpos) |
777 | hlist_add_behind(&policy->bydst, newpos); | 777 | hlist_add_behind_rcu(&policy->bydst, newpos); |
778 | else | 778 | else |
779 | hlist_add_head(&policy->bydst, chain); | 779 | hlist_add_head_rcu(&policy->bydst, chain); |
780 | __xfrm_policy_link(policy, dir); | 780 | __xfrm_policy_link(policy, dir); |
781 | 781 | ||
782 | /* After previous checking, family can either be AF_INET or AF_INET6 */ | 782 | /* After previous checking, family can either be AF_INET or AF_INET6 */ |