“7e5618de98c22ba1a906c0ad2cdc39ff8fefa6ed”上不存在“...awt/font/git@gitcode.net:openanolis/dragonwell8_jdk.git”
提交 a4b5e8a6 编写于 作者: P Pavel Skripkin 提交者: Zheng Zengkai

net: sched: fix warning in tcindex_alloc_perfect_hash

stable inclusion
from stable-5.10.50
commit 1148952dc660a90cead35fb89770f7369cf70ded
bugzilla: 174522 https://gitee.com/openeuler/kernel/issues/I4DNFY

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=1148952dc660a90cead35fb89770f7369cf70ded

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

[ Upstream commit 3f2db250 ]

Syzbot reported warning in tcindex_alloc_perfect_hash. The problem
was in too big cp->hash, which triggers warning in kmalloc. Since
cp->hash comes from userspace, there is no need to warn if value
is not correct

Fixes: b9a24bb7 ("net_sched: properly handle failure case of tcf_exts_init()")
Reported-and-tested-by: syzbot+1071ad60cd7df39fdadb@syzkaller.appspotmail.com
Signed-off-by: NPavel Skripkin <paskripkin@gmail.com>
Acked-by: NCong Wang <cong.wang@bytedance.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 8cfe487c
...@@ -304,7 +304,7 @@ static int tcindex_alloc_perfect_hash(struct net *net, struct tcindex_data *cp) ...@@ -304,7 +304,7 @@ static int tcindex_alloc_perfect_hash(struct net *net, struct tcindex_data *cp)
int i, err = 0; int i, err = 0;
cp->perfect = kcalloc(cp->hash, sizeof(struct tcindex_filter_result), cp->perfect = kcalloc(cp->hash, sizeof(struct tcindex_filter_result),
GFP_KERNEL); GFP_KERNEL | __GFP_NOWARN);
if (!cp->perfect) if (!cp->perfect)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册