Skip to content
Commit 2641f299 authored by Eric Dumazet's avatar Eric Dumazet Committed by Ben Hutchings
Browse files

pkt_sched: fq: do not accept silly TCA_FQ_QUANTUM

commit d9e15a27 upstream.

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: afe4fd06

 ("pkt_sched: fq: Fair Queue packet scheduler")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Diagnosed-by: default avatarFlorian Westphal <fw@strlen.de>
Reported-by: default avatar <syzbot+dc9071cc5a85950bdfce@syzkaller.appspotmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
[bwh: Backported to 3.16: Drop call to NL_SET_ERR_MSG_MOD() as extack is
 not supported.]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 3facfec8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment