summaryrefslogtreecommitdiff
path: root/net/sched
diff options
context:
space:
mode:
authorPavel Skripkin <paskripkin@gmail.com>2021-06-25 23:23:48 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-14 16:53:35 +0200
commiteff9dabc0068e01307c864e43bf7e2f571c29bd8 (patch)
tree4c9ec59335f7c06fc7b61cc6d7e090f544b915cb /net/sched
parent92071a2b8f7ff6365becce28e861bb1571bb9e10 (diff)
net: sched: fix warning in tcindex_alloc_perfect_hash
[ Upstream commit 3f2db250099f46988088800052cdf2332c7aba61 ] 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: b9a24bb76bf6 ("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>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/cls_tcindex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
index c9399e81c505..3e81f87d0c89 100644
--- a/net/sched/cls_tcindex.c
+++ b/net/sched/cls_tcindex.c
@@ -304,7 +304,7 @@ static int tcindex_alloc_perfect_hash(struct net *net, struct tcindex_data *cp)
int i, err = 0;
cp->perfect = kcalloc(cp->hash, sizeof(struct tcindex_filter_result),
- GFP_KERNEL);
+ GFP_KERNEL | __GFP_NOWARN);
if (!cp->perfect)
return -ENOMEM;