]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: sched: lock action when translating it to flow_action infra
authorVlad Buslov <vladbu@mellanox.com>
Mon, 17 Feb 2020 10:12:09 +0000 (12:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:29:37 +0000 (09:29 +0100)
commit066a637d1ce7ae912e73bd87764c9843bc24abde
treef2961dd8b13c14a85bb89c80e342f1bbab787694
parente7660f9535ade84ea57aed1c55d102bfb23dd2ff
net: sched: lock action when translating it to flow_action infra

[ Upstream commit 7a47281439ba00b11fc098f36695522184ce5a82 ]

In order to remove dependency on rtnl lock, take action's tcfa_lock when
constructing its representation as flow_action_entry structure.

Refactor tcf_sample_get_group() to assume that caller holds tcf_lock and
don't take it manually. This callback is only called from flow_action infra
representation translator which now calls it with tcf_lock held, so this
refactoring is necessary to prevent deadlock.

Allocate memory with GFP_ATOMIC flag for ip_tunnel_info copy because
tcf_tunnel_info_copy() is only called from flow_action representation infra
code with tcf_lock spinlock taken.

Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/tc_act/tc_tunnel_key.h
net/sched/act_sample.c
net/sched/cls_api.c