Skip to content

Commit d8751c0

Browse files
Lizhi XuNipaLocal
authored andcommitted
net/sched: Prevent notify to parent who unsupport class ops
If the parent qdisc does not support class operations then exit notify. In addition, the validity of the cl value is judged before executing the notify. Similarly, the notify is exited when the address represented by its value is invalid. Reported-by: syzbot+1261670bbdefc5485a06@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=1261670bbdefc5485a06 Tested-by: syzbot+1261670bbdefc5485a06@syzkaller.appspotmail.com Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com> Signed-off-by: NipaLocal <nipa@local>
1 parent 8b7ede1 commit d8751c0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/sched/sch_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,12 +803,13 @@ void qdisc_tree_reduce_backlog(struct Qdisc *sch, int n, int len)
803803
break;
804804
}
805805
cops = sch->ops->cl_ops;
806-
if (notify && cops->qlen_notify) {
806+
if (notify && cops && cops->qlen_notify) {
807807
/* Note that qlen_notify must be idempotent as it may get called
808808
* multiple times.
809809
*/
810810
cl = cops->find(sch, parentid);
811-
cops->qlen_notify(sch, cl);
811+
if (cl)
812+
cops->qlen_notify(sch, cl);
812813
}
813814
sch->q.qlen -= n;
814815
sch->qstats.backlog -= len;

0 commit comments

Comments
 (0)