diff options
author | Eric Dumazet <edumazet@google.com> | 2012-09-11 13:11:12 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-13 05:38:42 +0900 |
commit | 52ee75479f2aea816d8bb6a9d6caf5c1ebb36724 (patch) | |
tree | e3f3d348712777a3c47c0376ba2d970e71341dbb | |
parent | 6720119023f635bd8c285530a7092716c23bdfcc (diff) | |
download | linux-3.10-52ee75479f2aea816d8bb6a9d6caf5c1ebb36724.tar.gz linux-3.10-52ee75479f2aea816d8bb6a9d6caf5c1ebb36724.tar.bz2 linux-3.10-52ee75479f2aea816d8bb6a9d6caf5c1ebb36724.zip |
net-sched: sch_cbq: avoid infinite loop
[ Upstream commit bdfc87f7d1e253e0a61e2fc6a75ea9d76f7fc03a ]
Its possible to setup a bad cbq configuration leading to
an infinite loop in cbq_classify()
DEV_OUT=eth0
ICMP="match ip protocol 1 0xff"
U32="protocol ip u32"
DST="match ip dst"
tc qdisc add dev $DEV_OUT root handle 1: cbq avpkt 1000 \
bandwidth 100mbit
tc class add dev $DEV_OUT parent 1: classid 1:1 cbq \
rate 512kbit allot 1500 prio 5 bounded isolated
tc filter add dev $DEV_OUT parent 1: prio 3 $U32 \
$ICMP $DST 192.168.3.234 flowid 1:
Reported-by: Denys Fedoryschenko <denys@visp.net.lb>
Tested-by: Denys Fedoryschenko <denys@visp.net.lb>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | net/sched/sch_cbq.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 24d94c097b3..599f67ada1e 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c @@ -250,10 +250,11 @@ cbq_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) else if ((cl = defmap[res.classid & TC_PRIO_MAX]) == NULL) cl = defmap[TC_PRIO_BESTEFFORT]; - if (cl == NULL || cl->level >= head->level) + if (cl == NULL) goto fallback; } - + if (cl->level >= head->level) + goto fallback; #ifdef CONFIG_NET_CLS_ACT switch (result) { case TC_ACT_QUEUED: |