net_sched: sch_skbprio: add message validation to skbprio_change()
Subsystems (3)
PATCH 1/1 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 <[email protected]>
Reported-by syzbot <[email protected]>
--- net/sched/sch_skbprio.c | 3 +++ 1 file changed, 3 insertions(+)
net/sched/sch_skbprio.c +3 -0
@@ -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 ; }
Signature · 1 line
2.26.2.526.g744177e7f7-goog
David Miller
maintainerFrom: Eric Dumazet <[email protected]>
Date: Sat, 2 May 2020 20:09:25 -0700
Quoted 5 lines
Do not assume the attribute has the right size.
Fixes aea5f654e6b7 ("net/sched: add skbprio scheduler")Signed-off-by Eric Dumazet <[email protected]>Reported-by syzbot <[email protected]>
Applied and queued up for -stable, thanks Eric.