mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
xfrm: policy: use hlist rcu variants on insert
[ Upstream commit9dffff200f] bydst table/list lookups use rcu, so insertions must use rcu versions. Fixes:a7c44247f7("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2b0cdfb294
commit
4e670a32d2
@@ -625,9 +625,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);
|
||||
@@ -766,9 +766,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);
|
||||
|
||||
/* After previous checking, family can either be AF_INET or AF_INET6 */
|
||||
|
||||
Reference in New Issue
Block a user