]> git.baikalelectronics.ru Git - kernel.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)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 30 Apr 2019 11:55:00 +0000 (13:55 +0200)
commit935af871cffb36599801fae6000e8d6cb626abb3
tree7a93c05288668c8a07499157fba68bfd3bcf2f7d
parent12e67884fd80cc2454d47f96d8adcd4d031a702f
netfilter: nf_flow_table: fix netdev refcnt leak

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: d33443e2ecec ("netfilter: add generic flow table infrastructure")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_flow_offload.c