Skip to content

Commit 3f2db25

Browse files
pskrgagdavem330
authored andcommitted
net: sched: fix warning in tcindex_alloc_perfect_hash
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: [email protected] Signed-off-by: Pavel Skripkin <[email protected]> Acked-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fade564 commit 3f2db25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)