提交 f98bdcf4 编写于 作者: E Eric Dumazet 提交者: Yang Yingliang

net_sched: sch_skbprio: add message validation to skbprio_change()

stable inclusion
from linux-4.19.123
commit 37e33f51a81677bad469294903fbdc812b4ae0c6

--------------------------------

[ Upstream commit 2761121a ]

Do not assume the attribute has the right size.

Fixes: aea5f654 ("net/sched: add skbprio scheduler")
Signed-off-by: NEric Dumazet <edumazet@google.com>
Reported-by: Nsyzbot <syzkaller@googlegroups.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NLi Aichun <liaichun@huawei.com>
Reviewed-by: Nguodeqing <geffrey.guo@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 d2343910
...@@ -173,6 +173,9 @@ static int skbprio_change(struct Qdisc *sch, struct nlattr *opt, ...@@ -173,6 +173,9 @@ static int skbprio_change(struct Qdisc *sch, struct nlattr *opt,
{ {
struct tc_skbprio_qopt *ctl = nla_data(opt); struct tc_skbprio_qopt *ctl = nla_data(opt);
if (opt->nla_len != nla_attr_size(sizeof(*ctl)))
return -EINVAL;
sch->limit = ctl->limit; sch->limit = ctl->limit;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册