Skip to content

net/sched: flag inconsistent qdisc dumps

Reshma Sreekumar linux-kselftest lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2net/sched: flag inconsistent qdisc dumpsnet/sched/sch_api.c+15 -12 replies
2/2selftests: net: check that a disturbed qdisc dump is flaggedtools/testing/selftests/net/Makefile tools/testing/selftests/net/qdisc_dump_intr.py+124 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net 0/2] net/sched: flag inconsistent qdisc dumps

tc_dump_qdisc() walks every netdev in the netns and spans many netlink batches on any busy host. RTNL is only held while a single batch is filled, so the device list can change in between and the reply can miss entries -- but nothing under net/sched sets cb->seq, so NLM_F_DUMP_INTR is never raised and userspace cannot tell a partial listing from a complete one. rtnl_dump_ifinfo() already pairs for_each_netdev_dump() with cb->seq = dev_base_seq and nl_dump_check_consistent(); patch 1 does the same for the qdisc dump.

Patch 2 adds a selftest. Netlink dumps are driven by the reader, so it unregisters a device at a known point between two batches instead of racing against one, and a second case requires the flag to stay clear on an undisturbed dump. It fails on net/main and passes with patch 1.

Build coverage: allmodconfig builds clean with W=1 -- vmlinux and all modules link, no new warnings, none in net/sched. allyesconfig compiles clean with W=1, including net/sched/sch_api.o with no diagnostics in net/sched, but the final LD of vmlinux.o exceeds the memory of the machine used here, so that link was not completed.

Reshma Sreekumar (2):
net/sched: flag inconsistent qdisc dumps
selftests: net: check that a disturbed qdisc dump is flagged

 net/sched/sch_api.c                           |  16 ++-
 tools/testing/selftests/net/Makefile          |   1 +
 .../testing/selftests/net/qdisc_dump_intr.py  | 123 ++++++++++++++++++
 3 files changed, 139 insertions(+), 1 deletion(-)
 create mode 100755 tools/testing/selftests/net/qdisc_dump_intr.py

base-commit: 51b093a7ba27476e1f639455f005e8d2e75390e4

Signature · 1 line
2.43.0