Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37e33f51 authored by Eric Dumazet's avatar Eric Dumazet Committed by Greg Kroah-Hartman
Browse files

net_sched: sch_skbprio: add message validation to skbprio_change()



[ Upstream commit 2761121af87de45951989a0adada917837d8fa82 ]

Do not assume the attribute has the right size.

Fixes: aea5f654 ("net/sched: add skbprio scheduler")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b350c15a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -173,6 +173,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;
}