]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: ctnetlink: fix possible refcount leak in ctnetlink_create_conntrack()
authorHangyu Hua <hbh25y@gmail.com>
Fri, 10 Feb 2023 07:17:30 +0000 (15:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:44:11 +0000 (16:44 +0100)
commit9260dac83c73b2cbc32a6d39b328d0cb05bb050f
tree3901f717bce8ce85b1d92b050474065078633677
parent28b4d1410cf62c48100c334d60828b2939d281e2
netfilter: ctnetlink: fix possible refcount leak in ctnetlink_create_conntrack()

[ Upstream commit ac4893980bbe79ce383daf9a0885666a30fe4c83 ]

nf_ct_put() needs to be called to put the refcount got by
nf_conntrack_find_get() to avoid refcount leak when
nf_conntrack_hash_check_insert() fails.

Fixes: 7afef6ab0b27 ("netfilter: ctnetlink: fix soft lockup when netlink adds new entries (v2)")
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_conntrack_netlink.c