Skip to content

net/sched: taprio: fix NULL pointer dereference in class dump

Weiming Shi linux-kselftest netdev 5 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 3 repliesApplied 2/2
  2. v42 patches 1 replySuperseded
  3. v31 patch 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v21 patch2 repliesSuperseded
v11 patch3 repliesSuperseded

Patches in v5 All 2 applied

#Subject and filesSizeRepliesApplied
1/2net/sched: taprio: fix NULL pointer dereference in class dumpnet/sched/sch_taprio.c+8 -52 repliesApplied
2/2selftests/tc-testing: add taprio test for class dump after child deletetools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json+26 -01 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchJamal Hadi SalimWeiming Shi
1/2A-b T-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH net v5 0/2] net/sched: taprio: fix NULL pointer dereference in class dump

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.

v5: only call qdisc_put(*old) when *old is non-NULL and not
&noop_qdisc (Paolo).
v4: https://lore.kernel.org/netdev/[email protected]/
add selftests/tc-testing regression test (patch 2/2) (Jamal). add Assisted-by tag.
v3: https://lore.kernel.org/netdev/[email protected]/
fix broken patch
v2: https://lore.kernel.org/netdev/[email protected]/
also update NULL guards in taprio_enqueue() and taprio_dequeue_from_txq() to avoid qlen/backlog inflation (Paolo).
v1: https://lore.kernel.org/netdev/[email protected]/

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                        | 13 ++++++----
 .../tc-testing/tc-tests/qdiscs/taprio.json    | 26 +++++++++++++++++++
 2 files changed, 34 insertions(+), 5 deletions(-)
Signature · 1 line
2.43.0