Florian Westphal 4a02426787 netfilter: tproxy: fix deadlock due to missing BH disable
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: 4ed8eb6570a4 ("netfilter: nf_tables: Add native tproxy support")
Reported-and-tested-by: Major Dávid <major.david@balasys.hu>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2023-03-06 12:09:48 +01:00
..
2022-12-06 07:30:55 +09:00
2021-07-01 13:19:48 -07:00
2022-06-22 12:59:43 +01:00
2022-08-23 10:43:11 +02:00
2022-07-28 22:06:15 -07:00
2022-08-09 22:14:02 -07:00
2021-12-16 07:18:35 -08:00
2021-10-15 11:33:08 +01:00
2023-02-02 14:02:01 +01:00
2021-10-13 09:40:46 -07:00
2021-07-27 13:05:56 +01:00
2022-05-11 12:43:10 +01:00
2020-03-04 13:25:55 -08:00
2023-02-03 19:56:23 -08:00
2022-06-19 10:00:02 +01:00
2019-10-05 16:29:00 -07:00
2021-08-03 13:05:26 +01:00
2023-02-16 09:27:07 +01:00
2022-12-12 11:27:42 -08:00
2022-12-12 15:04:39 -08:00
2019-12-09 10:28:43 -08:00
2023-02-02 20:48:23 -08:00
2022-12-12 11:27:42 -08:00