net/sched: clamp quantum/psched_mtu in change paths
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
- v3 Latest9 patches 14 repliesApplied 9/9
- v28 patches 3 repliesSuperseded
- v11 patch 3 repliesSuperseded
Changes in v3 from the cover letter
- Add patch 9/9: update tdc case 41f5 (ETS offload quanta wrap test) - the [256, 1<<20] clamp in ets_quantum_parse() rejects/normalises the wrapping quanta 41f5 asserts verbatim, so the tc executor run failed (Jakub). 41f5 now matches the clamped values (quanta 1048576 256 256) and its name reflects the new behavior.
- No kernel-code changes; patches 1-8 are identical to v2.
Patches in v3 All 9 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | net/sched: fq: clamp quantum and initial_quantum in change pathnet/ | +5 | 7 replies | Applied |
| 2/9 | net/sched: fq_pie: clamp quantum in change pathnet/ | +2 | 0 replies | Applied |
| 3/9 | net/sched: sfq: clamp quantum in change pathnet/ | +6 | 1 reply | Applied |
| 4/9 | net/sched: hhf: clamp quantum in change and init pathsnet/ | +2 | 1 reply | Applied |
| 5/9 | net/sched: dualpi2: clamp psched_mtu at all call sitesnet/ | +7 | 1 reply | Applied |
| 6/9 | net/sched: pie: clamp psched_mtu in pie_drop_earlynet/ | +1 | 1 reply | Applied |
| 7/9 | net/sched: drr: clamp quantum in change classnet/ | +2 | 1 reply | Applied |
| 8/9 | net/sched: ets: clamp quantum in parse and fallback pathsnet/ | +5 | 1 reply | Applied |
| 9/9 | selftests: tc-testing: update ETS test 41f5 for clamped quantatools/ | +2 | 1 reply | Applied |
Reviews trailers per patch
8 of 9 patches have a Reviewed-by or Acked-by.
| Patch | Toke Høiland-Jørgensen | Victor Nogueira |
|---|---|---|
| 1/9 | R-b | T-b |
| 2/9 | R-b | T-b |
| 3/9 | R-b | T-b |
| 4/9 | R-b | T-b |
| 5/9 | R-b | T-b |
| 6/9 | R-b | T-b |
| 7/9 | R-b | T-b |
| 8/9 | R-b | T-b |
| 9/9 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net v3 0/9] net/sched: clamp quantum/psched_mtu in change paths
This is a followup to commit 709f34f7c28d ("net/sched: fq: add overflow bounds to quantum and initial quantum").
The quantum_backlog_overflow series and the five siblings that followed clamped the init-path quantum in fq, fq_codel, fq_pie, hhf, sfq. The change() paths were not clamped but it is the same pattern, same writer of q->quantum, same privilege level (CAP_NET_ADMIN in a user namespace). A user can override the init clamp via tc qdisc change, restoring the small-quantum deficit spin that the init clamp was meant to prevent.
This series also covers two siblings that were missed entirely by the original series: sch_dualpi2 and sch_pie call psched_mtu() without any clamp at all. With a crafted size table qdisc_pkt_len reaches ~2 GiB, so quantum=1 (or a zero psched_mtu on a headerless device) makes the deficit-refill loop spin ~2^31 times under the qdisc lock (a soft lockup / denial of service).
Each patch fixes one qdisc with its own Fixes: tag so they can be backported independently - the commits they fix shift differently in the git tree.
Patch 1: fq - clamp TCA_FQ_QUANTUM and TCA_FQ_INITIAL_QUANTUM in change Patch 2: fq_pie - clamp quantum in change path
Patch 3: sfq - clamp quantum and reject > 1<<20 in change path Patch 4: hhf - clamp quantum in change and init paths
Patch 5: dualpi2 - clamp psched_mtu at all 3 call sites Patch 6: pie - clamp psched_mtu in pie_drop_early
Patch 7: drr - clamp quantum in change class
Patch 8: ets - clamp quantum in parse and fallback paths Patch 9: selftests - update ETS test 41f5 for clamped quanta
Conditions to recreate (applies to all): create the qdisc, then tc qdisc change ... quantum 1 with a STAB size table inflating qdisc_pkt_len. Requires CAP_NET_ADMIN in a user namespace (unshare -Urn).
Sashiko links:
- v1: https://sashiko.dev/#/patchset/[email protected]
- v2: https://sashiko.dev/#/patchset/[email protected]
v2 -> v3:
- Add patch 9/9: update tdc case 41f5 (ETS offload quanta wrap test) - the [256, 1<<20] clamp in ets_quantum_parse() rejects/normalises the wrapping quanta 41f5 asserts verbatim, so the tc executor run failed (Jakub). 41f5 now matches the clamped values (quanta 1048576 256 256) and its name reflects the new behavior.
- No kernel-code changes; patches 1-8 are identical to v2.
v1 -> v2:
- Split the single monolithic patch into 8 per-qdisc patches, each with its own Fixes: tag, so stable backports can cherry-pick individually.
- Add cover letter.
- ETS: move 256 floor into ets_quantum_parse() so explicit quanta are clamped, not just the fallback path (Sashiko gemini + nipa gpt-5-6-sol-1-7).
- DRR: add upper bound clamp_t(u32, quantum, 256, 1<<20) matching sfq (Sashiko nipa gpt-5-6-sol-3-19).
- ETS: add upper bound clamp in ets_quantum_parse() and fallback path.
- sch_fq: add 256 floor in fq_change() for TCA_FQ_QUANTUM and clamp fq_init() quantum to [256, 1<<20] for tiny-MTU devices
(Sashiko gemini + nipa main-1-1).
- hhf: clamp hhf_init() to [256, 1<<20] matching siblings (Sashiko gemini + nipa gpt-5-6-sol-6-24).
- Add Fixes: dcc68b4d8084 for ETS (Sashiko nipa gpt-5-6-sol-1-8).
- Re-add Toke's Reviewed-by from v1 (kept since v2 only splits the patch, the code Toke reviewed is unchanged in approach).
Jamal Hadi Salim (9):
net/sched: fq: clamp quantum and initial_quantum in change path net/sched: fq_pie: clamp quantum in change path net/sched: sfq: clamp quantum in change path net/sched: hhf: clamp quantum in change and init paths net/sched: dualpi2: clamp psched_mtu at all call sites net/sched: pie: clamp psched_mtu in pie_drop_early net/sched: drr: clamp quantum in change class net/sched: ets: clamp quantum in parse and fallback paths
selftests: tc-testing: update ETS test 41f5 for clamped quanta