syzbot found that forcing a big quantum attribute would crash hosts fast, essentially using this: tc qd replace dev eth0 root fq_codel quantum 4294967295 This is because fq_codel_dequeue() would have to loop ~2^31 times in : if (flow->deficit <= 0) { flow->deficit += q->quantum; list_move_tail(&flow->flowchain, &q->old_flows); goto begin; } SFQ max quantum is 2^19 (half a megabyte) Lets adopt a max quantum of one megabyte for FQ_CODEL.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -827,6 +827,8 @@ struct tc_codel_xstats { · 826 unmodified lines | ||
| 827 | 827 | |
| 828 | 828 | /* FQ_CODEL */ |
| 829 | 829 | |
| 830 | +#define FQ_CODEL_QUANTUM_MAX (1 << 20) | |
| 831 | + | |
| 830 | 832 | enum { |
| 831 | 833 | TCA_FQ_CODEL_UNSPEC, |
| 832 | 834 | TCA_FQ_CODEL_TARGET, |