]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: free flowtable hooks on hook register error
authorFlorian Westphal <fw@strlen.de>
Mon, 2 Mar 2020 20:58:50 +0000 (21:58 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 4 Mar 2020 01:27:18 +0000 (02:27 +0100)
commit408f2ff447862b5d2204fb58ed5ee05fdbd713fb
tree3977efbf75e00c7c57bb970e89dd59cf07713926
parent8ceb27e7d681d658b42514a89e10719e40381fa7
netfilter: nf_tables: free flowtable hooks on hook register error

If hook registration fails, the hooks allocated via nft_netdev_hook_alloc
need to be freed.

We can't change the goto label to 'goto 5' -- while it does fix the memleak
it does cause a warning splat from the netfilter core (the hooks were not
registered).

Fixes: 4a9aad95eb40 ("netfilter: nf_tables: dynamically allocate hooks per net_device in flowtables")
Reported-by: syzbot+a2ff6fa45162a5ed4dd3@syzkaller.appspotmail.com
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c