]> git.baikalelectronics.ru Git - kernel.git/commit
fq_codel: reject silly quantum parameters
authorEric Dumazet <edumazet@google.com>
Fri, 3 Sep 2021 22:03:43 +0000 (15:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 4 Sep 2021 09:49:46 +0000 (10:49 +0100)
commitd20fc42da8e6c43066b4e94a35c74de09b12631c
tree73d9af6b6cc1fc846633747ce81c900a46e27960
parent3a31d04d115c7874b529c0290d47f799b15cd39d
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.

Fixes: c799588b6cbc ("fq_codel: Fair Queue Codel AQM")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/pkt_sched.h
net/sched/sch_fq_codel.c