]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: fix memory leaks on netlink_dump_start error
authorFlorian Westphal <fw@strlen.de>
Tue, 31 Jul 2018 11:41:23 +0000 (13:41 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 16 Aug 2018 17:37:00 +0000 (19:37 +0200)
commit339673edb4b3f3f3fc929f0dd273cdbbb6a27946
tree385d7d6561f7595aae77c8780709fec4a7aa5d36
parent7d2e75d63b3fcdce4910f6e04224917d23eba9b6
netfilter: fix memory leaks on netlink_dump_start error

Shaochun Chen points out we leak dumper filter state allocations
stored in dump_control->data in case there is an error before netlink sets
cb_running (after which ->done will be called at some point).

In order to fix this, add .start functions and move allocations there.

Same pattern as used in commit 3db1846e464dc38a541d3e80f94ba849ed5b9be4
("netfilter: nf_tables: move dumper state allocation into ->start").

Reported-by: shaochun chen <cscnull@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_netlink.c
net/netfilter/nfnetlink_acct.c