Skip to content

Commit 1148952

Browse files
pskrgaggregkh
authored andcommitted
net: sched: fix warning in tcindex_alloc_perfect_hash
[ Upstream commit 3f2db25 ] 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: b9a24bb ("net_sched: properly handle failure case of tcf_exts_init()") Reported-and-tested-by: syzbot+1071ad60cd7df39fdadb@syzkaller.appspotmail.com Signed-off-by: Pavel Skripkin <paskripkin@gmail.com> Acked-by: Cong Wang <cong.wang@bytedance.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4476568 commit 1148952

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/sched/cls_tcindex.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ static int tcindex_alloc_perfect_hash(struct net *net, struct tcindex_data *cp)
304304
int i, err = 0;
305305

306306
cp->perfect = kcalloc(cp->hash, sizeof(struct tcindex_filter_result),
307-
GFP_KERNEL);
307+
GFP_KERNEL | __GFP_NOWARN);
308308
if (!cp->perfect)
309309
return -ENOMEM;
310310

0 commit comments

Comments
 (0)