From 8f58d09a55ec37eacd9fe21892bf4fe5d2ae32ff Mon Sep 17 00:00:00 2001 From: Denis Kirjanov Date: Apr 25 2023 08:43:20 +0000 Subject: xfrm: policy: use hlist rcu variants on insert (git-fixes). --- diff --git a/patches.suse/xfrm-policy-use-hlist-rcu-variants-on-insert.patch b/patches.suse/xfrm-policy-use-hlist-rcu-variants-on-insert.patch new file mode 100644 index 0000000..535cdc6 --- /dev/null +++ b/patches.suse/xfrm-policy-use-hlist-rcu-variants-on-insert.patch @@ -0,0 +1,49 @@ +From e80e2d89b17b6a2c39e1401107d1198d76c7a21d Mon Sep 17 00:00:00 2001 +From: Florian Westphal +Date: Wed, 10 Oct 2018 18:02:21 +0200 +Subject: [PATCH] xfrm: policy: use hlist rcu variants on insert +Git-commit: 9dffff200fd178f11dd50eb1fd8ccd0650c9284e +Patch-mainline: v4.19 +References: git-fixes + +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 +Signed-off-by: Steffen Klassert +Signed-off-by: Denis Kirjanov +--- + 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 8463a59983e1..0be5d051f104 100644 +--- a/net/xfrm/xfrm_policy.c ++++ b/net/xfrm/xfrm_policy.c +@@ -654,9 +654,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); +@@ -795,9 +795,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.16.4 + diff --git a/series.conf b/series.conf index 5167e02..5e874e4 100644 --- a/series.conf +++ b/series.conf @@ -41454,6 +41454,7 @@ patches.suse/udp6-fix-encap-return-code-for-resubmitting.patch patches.suse/virtio_net-avoid-using-netif_tx_disable-for-serializ.patch patches.suse/net-ipmr-fix-unresolved-entry-dumps.patch + patches.suse/xfrm-policy-use-hlist-rcu-variants-on-insert.patch patches.suse/r8169-fix-NAPI-handling-under-high-load.patch patches.suse/net-sched-Fix-for-duplicate-class-dump.patch patches.suse/net-socket-fix-a-missing-check-bug.patch