mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 20:03:33 -04:00
net_sched: sch_skbprio: add message validation to skbprio_change()
[ Upstream commit 2761121af87de45951989a0adada917837d8fa82 ]
Do not assume the attribute has the right size.
Fixes: aea5f654e6 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c78c166748
commit
b51b394f4a
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue