]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/sched: sch_taprio: ensure to reset/destroy all child qdiscs
authorDavide Caratti <dcaratti@redhat.com>
Thu, 17 Dec 2020 21:29:46 +0000 (22:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jan 2021 19:16:16 +0000 (20:16 +0100)
commit3f2a28930a7eae7a811af0897b4aac7af5238fe6
treeb69f3682bbf98c431ee6a93a53ad4a668284760e
parentc41ea30c3839bce0ad775304a91beeb736d8e2e4
net/sched: sch_taprio: ensure to reset/destroy all child qdiscs

[ Upstream commit 698285da79f5b0b099db15a37ac661ac408c80eb ]

taprio_graft() can insert a NULL element in the array of child qdiscs. As
a consquence, taprio_reset() might not reset child qdiscs completely, and
taprio_destroy() might leak resources. Fix it by ensuring that loops that
iterate over q->qdiscs[] don't end when they find the first NULL item.

Fixes: 44d4775ca518 ("net/sched: sch_taprio: reset child qdiscs before freeing them")
Fixes: 5a781ccbd19e ("tc: Add support for configuring the taprio scheduler")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Link: https://lore.kernel.org/r/13edef6778fef03adc751582562fba4a13e06d6a.1608240532.git.dcaratti@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sched/sch_taprio.c