]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nf_flow_table: fix netdev refcnt leak
authorTaehee Yoo <ap420073@gmail.com>
Mon, 29 Apr 2019 16:55:29 +0000 (01:55 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Jun 2019 09:52:59 +0000 (11:52 +0200)
commit11ae693f445fd1515b84c86a5d5d57447a78a583
tree10e9554052cb7ed43e06e14fee5eb042e1a98d3d
parentc155f374d89ea0444729e7484181ffcc623f4b2b
netfilter: nf_flow_table: fix netdev refcnt leak

[ Upstream commit 26a302afbe328ecb7507cae2035d938e6635131b ]

flow_offload_alloc() calls nf_route() to get a dst_entry. Internally,
nf_route() calls ip_route_output_key() that allocates a dst_entry and
holds it. So, a dst_entry should be released by dst_release() if
nf_route() is successful.

Otherwise, netns exit routine cannot be finished and the following
message is printed:

[  257.490952] unregister_netdevice: waiting for lo to become free. Usage count = 1

Fixes: ac2a66665e23 ("netfilter: add generic flow table infrastructure")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_flow_offload.c