diff options
author | Eric Dumazet <edumazet@google.com> | 2020-05-03 05:09:25 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-04 00:52:13 +0200 |
commit | 2761121af87de45951989a0adada917837d8fa82 (patch) | |
tree | 2a7faebf0e32074ba10339ed0b0a43adab622bd3 /net | |
parent | drop_monitor: work around gcc-10 stringop-overflow warning (diff) | |
download | linux-2761121af87de45951989a0adada917837d8fa82.tar.xz linux-2761121af87de45951989a0adada917837d8fa82.zip |
net_sched: sch_skbprio: add message validation to skbprio_change()
Do not assume the attribute has the right size.
Fixes: aea5f654e6b7 ("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>
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/sch_skbprio.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sched/sch_skbprio.c b/net/sched/sch_skbprio.c index 0fb10abf7579..7a5e4c454715 100644 --- a/net/sched/sch_skbprio.c +++ b/net/sched/sch_skbprio.c @@ -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; } |