Commit 4eba9564 authored by Florian Westphal's avatar Florian Westphal Committed by sanglipeng
Browse files

netfilter: tproxy: fix deadlock due to missing BH disable

stable inclusion
from stable-v5.10.175
commit 065c1ed5c4cec2ae676f2b6b35fd13acf85a11eb
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8711T

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=065c1ed5c4cec2ae676f2b6b35fd13acf85a11eb

--------------------------------

[ Upstream commit 4a024267 ]

The xtables packet traverser performs an unconditional local_bh_disable(),
but the nf_tables evaluation loop does not.

Functions that are called from either xtables or nftables must assume
that they can be called in process context.

inet_twsk_deschedule_put() assumes that no softirq interrupt can occur.
If tproxy is used from nf_tables its possible that we'll deadlock
trying to aquire a lock already held in process context.

Add a small helper that takes care of this and use it.

Link: https://lore.kernel.org/netfilter-devel/401bd6ed-314a-a196-1cdc-e13c720cc8f2@balasys.hu/


Fixes: 4ed8eb65 ("netfilter: nf_tables: Add native tproxy support")
Reported-and-tested-by: default avatarMajor Dávid <major.david@balasys.hu>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 2b43f811
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment