diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2019-09-08 12:11:23 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-09-10 18:28:56 +0100 |
commit | 8b142a00edcf8422ca48b8de88d286efb500cb53 (patch) | |
tree | 7b5884211098274bc914b12de206aa3f58cee28d /net/sched/sch_api.c | |
parent | 94a72b3f024fc7e9ab640897a1e38583a470659d (diff) | |
download | linux-rt-8b142a00edcf8422ca48b8de88d286efb500cb53.tar.gz |
net_sched: check cops->tcf_block in tc_bind_tclass()
At least sch_red and sch_tbf don't implement ->tcf_block()
while still have a non-zero tc "class".
Instead of adding nop implementations to each of such qdisc's,
we can just relax the check of cops->tcf_block() in
tc_bind_tclass(). They don't support TC filter anyway.
Reported-by: syzbot+21b29db13c065852f64b@syzkaller.appspotmail.com
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r-- | net/sched/sch_api.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 04faee7ccbce..1047825d9f48 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1920,6 +1920,8 @@ static void tc_bind_tclass(struct Qdisc *q, u32 portid, u32 clid, cl = cops->find(q, portid); if (!cl) return; + if (!cops->tcf_block) + return; block = cops->tcf_block(q, cl, NULL); if (!block) return; |