public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v4 0/2] net/sched: taprio: fix NULL pointer dereference in class dump
@ 2026-04-16 18:55 Weiming Shi
  2026-04-16 18:55 ` [PATCH net v4 1/2] " Weiming Shi
  2026-04-16 18:55 ` [PATCH net v4 2/2] selftests/tc-testing: add taprio test for class dump after child delete Weiming Shi
  0 siblings, 2 replies; 3+ messages in thread
From: Weiming Shi @ 2026-04-16 18:55 UTC (permalink / raw)
  To: jhs, vinicius.gomes, jiri, davem, edumazet, kuba, pabeni, shuah
  Cc: horms, vladimir.oltean, xmei5, netdev, linux-kselftest,
	Weiming Shi

Fix a NULL pointer dereference in taprio_dump_class() reachable by an
unprivileged local user on kernels with unprivileged user namespaces
enabled and CONFIG_NET_SCH_TAPRIO=y. The bug allows a local DoS via a
crafted sequence of taprio child-qdisc graft, delete, and class dump.

Patch 1/2 is the fix: replace NULL entries in q->qdiscs[] with the
global &noop_qdisc singleton so that control-plane dump paths, as well
as the existing NULL guards in the data-plane enqueue/dequeue paths,
cannot deref a NULL child qdisc.

Patch 2/2 is a tdc regression test that drives the graft + delete +
class-dump sequence on a multi-queue netdevsim device. It panics the
vulnerable kernel and passes on the fixed one.

v4:
  add selftests/tc-testing regression test (patch 2/2) (Jamal).
  add Assisted-by tag.
v3: https://lore.kernel.org/netdev/20260414104311.74115-2-bestswngs@gmail.com/
    fix broken patch
v2: https://lore.kernel.org/netdev/20260410153902.955227-2-bestswngs@gmail.com/
    also update NULL guards in taprio_enqueue() and
    taprio_dequeue_from_txq() to avoid qlen/backlog inflation (Paolo).
v1: https://lore.kernel.org/netdev/20260330102904.2677818-5-bestswngs@gmail.com/

Weiming Shi (2):
  net/sched: taprio: fix NULL pointer dereference in class dump
  selftests/tc-testing: add taprio test for class dump after child
    delete

 net/sched/sch_taprio.c                        | 11 +++++---
 .../tc-testing/tc-tests/qdiscs/taprio.json    | 26 +++++++++++++++++++
 2 files changed, 33 insertions(+), 4 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-16 18:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-16 18:55 [PATCH net v4 0/2] net/sched: taprio: fix NULL pointer dereference in class dump Weiming Shi
2026-04-16 18:55 ` [PATCH net v4 1/2] " Weiming Shi
2026-04-16 18:55 ` [PATCH net v4 2/2] selftests/tc-testing: add taprio test for class dump after child delete Weiming Shi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox