]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: ipt_CLUSTERIP: fix refcount leak in clusterip_tg_check()
authorXin Xiong <xiongx18@fudan.edu.cn>
Thu, 23 Dec 2021 02:48:12 +0000 (10:48 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 5 Jan 2022 16:20:17 +0000 (17:20 +0100)
commitbd18c501295ad2158be704125a3b99c18d6d6d1a
tree2eef0ccaf67ccb88ffef1dc24ca6a4bb58494669
parent48f6cc618887973cd68b2f10ca9b3f886c5245e1
netfilter: ipt_CLUSTERIP: fix refcount leak in clusterip_tg_check()

The issue takes place in one error path of clusterip_tg_check(). When
memcmp() returns nonzero, the function simply returns the error code,
forgetting to decrease the reference count of a clusterip_config
object, which is bumped earlier by clusterip_config_find_get(). This
may incur reference count leak.

Fix this issue by decrementing the refcount of the object in specific
error path.

Fixes: 473c8021c08503 ("netfilter: ipt_CLUSTERIP: check MAC address when duplicate config is set")
Signed-off-by: Xin Xiong <xiongx18@fudan.edu.cn>
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/ipv4/netfilter/ipt_CLUSTERIP.c