diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 7156f64a200479b856f411c033d959d447922776..46a8939e247736b92d578683b8933e4da2caab2b 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -2161,6 +2161,12 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, return -EOPNOTSUPP; } + /* Prevent creation of traffic classes with classid TC_H_ROOT */ + if (clid == TC_H_ROOT) { + NL_SET_ERR_MSG(extack, "Cannot create traffic class with classid TC_H_ROOT"); + return -EINVAL; + } + new_cl = cl; err = -EOPNOTSUPP; if (cops->change)