Skip to content

Commit

Permalink
net_sched: sch_skbprio: add message validation to skbprio_change()
Browse files Browse the repository at this point in the history
Do not assume the attribute has the right size.

Fixes: aea5f65 ("net/sched: add skbprio scheduler")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed May 3, 2020
1 parent dc30b40 commit 2761121
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/sched/sch_skbprio.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ static int skbprio_change(struct Qdisc *sch, struct nlattr *opt,
{
struct tc_skbprio_qopt *ctl = nla_data(opt);

if (opt->nla_len != nla_attr_size(sizeof(*ctl)))
return -EINVAL;

sch->limit = ctl->limit;
return 0;
}
Expand Down

0 comments on commit 2761121

Please sign in to comment.