History

fq_codel: reject silly quantum parameters

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.

Eric Dumazet committed 5 years ago

Commit c7c5e6f1 parent 10905b42 files · +12 −2Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/pkt_sched.h+2−0
@@ -827,6 +827,8 @@ struct tc_codel_xstats { · 826 unmodified lines
827827
828828 /* FQ_CODEL */
829829
830+#define FQ_CODEL_QUANTUM_MAX (1 << 20)
831+
830832 enum {
831833 TCA_FQ_CODEL_UNSPEC,
832834 TCA_FQ_CODEL_TARGET,