]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/tc-testing: add taprio test for class dump after child delete
authorWeiming Shi <bestswngs@gmail.com>
Wed, 22 Apr 2026 16:19:59 +0000 (00:19 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 28 Apr 2026 01:41:36 +0000 (18:41 -0700)
commita469feed399da791f890b3448622121e97a07f3b
treedabf81e73be562d555e9d59e2fddf1adb4caffb8
parent3d07ca5c0fae311226f737963984bd94bb159a87
selftests/tc-testing: add taprio test for class dump after child delete

Add a regression test for the NULL pointer dereference fixed in the
previous commit. Before the fix, taprio_graft() stored NULL into
q->qdiscs[cl - 1] when an explicitly grafted child qdisc was deleted
via RTM_DELQDISC; the next RTM_GETTCLASS dump then crashed the kernel
in taprio_dump_class() while reading child->handle.

The test installs a taprio root qdisc on a multi-queue netdevsim
device, grafts a pfifo child onto class 8001:1, deletes that child,
and then performs a class dump. On a fixed kernel the dump succeeds
and all eight taprio classes are listed; on an unpatched kernel the
class dump crashes, which surfaces as a test failure.

Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://patch.msgid.link/20260422161958.2517539-4-bestswngs@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json