]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_nat_masquerade: defer conntrack walk to work queue
authorFlorian Westphal <fw@strlen.de>
Wed, 15 Sep 2021 14:46:39 +0000 (16:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Oct 2021 08:42:34 +0000 (10:42 +0200)
commit0111ed1752095fd5207480667beb8f744b851238
treee6172b316def4b208aa365b3a57bbec3dbe0c6ff
parent09014e3881653ccbddfc16147768626837a090f3
netfilter: nf_nat_masquerade: defer conntrack walk to work queue

[ Upstream commit 7970a19b71044bf4dc2c1becc200275bdf1884d4 ]

The ipv4 and device notifiers are called with RTNL mutex held.
The table walk can take some time, better not block other RTNL users.

'ip a' has been reported to block for up to 20 seconds when conntrack table
has many entries and device down events are frequent (e.g., PPP).

Reported-and-tested-by: Martin Zaharinov <micron10@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_nat_masquerade.c