]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
pkt_sched: fq: do not accept silly TCA_FQ_QUANTUM
authorEric Dumazet <edumazet@google.com>
Mon, 6 Jan 2020 14:10:39 +0000 (06:10 -0800)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 30 Jan 2020 15:23:22 +0000 (16:23 +0100)
commitc787e10c3c52e608a994f6bae0ac50e7a78694c7
tree6d5c4f559e675112a89ba804aec757d57c71da73
parentf4832860ccb4727390d8497fc2131c4e2ce57982
pkt_sched: fq: do not accept silly TCA_FQ_QUANTUM

BugLink: https://bugs.launchpad.net/bugs/1860130
[ Upstream commit d9e15a2733067c9328fb56d98fe8e574fa19ec31 ]

As diagnosed by Florian :

If TCA_FQ_QUANTUM is set to 0x80000000, fq_deueue()
can loop forever in :

if (f->credit <= 0) {
  f->credit += q->quantum;
  goto begin;
}

... because f->credit is either 0 or -2147483648.

Let's limit TCA_FQ_QUANTUM to no more than 1 << 20 :
This max value should limit risks of breaking user setups
while fixing this bug.

Fixes: afe4fd062416 ("pkt_sched: fq: Fair Queue packet scheduler")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Diagnosed-by: Florian Westphal <fw@strlen.de>
Reported-by: syzbot+dc9071cc5a85950bdfce@syzkaller.appspotmail.com
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
net/sched/sch_fq.c