]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: Fix qdisc_rate_table refcount leak when get tcf_block failed
authorXiyu Yang <xiyuyang19@fudan.edu.cn>
Sun, 29 Aug 2021 15:58:01 +0000 (23:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 07:47:38 +0000 (09:47 +0200)
commitf15d873df948ec25e938bbe4ddb8630b730bcc5f
tree7cde7af635910000f1b4e593af06328d3d2c2c15
parente6d69e2dcd9e96b2fbf790978deb0342c3e5c191
net: sched: Fix qdisc_rate_table refcount leak when get tcf_block failed

[ Upstream commit c66070125837900163b81a03063ddd657a7e9bfb ]

The reference counting issue happens in one exception handling path of
cbq_change_class(). When failing to get tcf_block, the function forgets
to decrease the refcount of "rtab" increased by qdisc_put_rtab(),
causing a refcount leak.

Fix this issue by jumping to "failure" label when get tcf_block failed.

Fixes: d3b0101d3512 ("net: sched: introduce tcf block infractructure")
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Reviewed-by: Cong Wang <cong.wang@bytedance.com>
Link: https://lore.kernel.org/r/1630252681-71588-1-git-send-email-xiyuyang19@fudan.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sched/sch_cbq.c