]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: move dumper state allocation into ->start
authorFlorian Westphal <fw@strlen.de>
Mon, 23 Jul 2018 10:47:14 +0000 (12:47 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 23 Jul 2018 22:36:33 +0000 (00:36 +0200)
commit4531e8f6fd22fed45e1b0b14ad80c5bbd57fa15d
tree6245dc04a7b2cda296665138ccd0f5f0852fe7b8
parent9a92f3257326404dd25b5398fd367fa714e3f401
netfilter: nf_tables: move dumper state allocation into ->start

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 do the allocations
there.

->done is going to clean up, and in case error occurs before
->start invocation no cleanups need to be done anymore.

Reported-by: shaochun chen <cscnull@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c