mirror of
https://github.com/torvalds/linux.git
synced 2024-11-17 17:41:44 +00:00
netfilter: nf_tables: fix memory leak in nf_tables_parse_netdev_hooks()
Syzbot detected a leak in nf_tables_parse_netdev_hooks(). If the hook
already exists, then the error handling doesn't free the newest "hook".
Reported-by: syzbot+f9d4095107fc8749c69c@syzkaller.appspotmail.com
Fixes: b75a3e8371
("netfilter: nf_tables: allow netdevice to be used only once per flowtable")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
9332d27d79
commit
cd77e75b5e
@ -1680,6 +1680,7 @@ static int nf_tables_parse_netdev_hooks(struct net *net,
|
||||
goto err_hook;
|
||||
}
|
||||
if (nft_hook_list_find(hook_list, hook)) {
|
||||
kfree(hook);
|
||||
err = -EEXIST;
|
||||
goto err_hook;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user