Skip to content

Commit f45f6ec

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: [email protected] Closes: https://syzkaller.appspot.com/bug?extid=1261670bbdefc5485a06 Tested-by: [email protected] Signed-off-by: Lizhi Xu <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 260b806 commit f45f6ec

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
@@ -808,12 +808,13 @@ void qdisc_tree_reduce_backlog(struct Qdisc *sch, int n, int len)
808808
break;
809809
}
810810
cops = sch->ops->cl_ops;
811-
if (notify && cops->qlen_notify) {
811+
if (notify && cops && cops->qlen_notify) {
812812
/* Note that qlen_notify must be idempotent as it may get called
813813
* multiple times.
814814
*/
815815
cl = cops->find(sch, parentid);
816-
cops->qlen_notify(sch, cl);
816+
if (cl)
817+
cops->qlen_notify(sch, cl);
817818
}
818819
sch->q.qlen -= n;
819820
sch->qstats.backlog -= len;

0 commit comments

Comments
 (0)