diff options
author | Pavel Skripkin <paskripkin@gmail.com> | 2021-06-25 23:23:48 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-20 16:17:38 +0200 |
commit | 63594fd2f764c2d13bf1f71b1e73b4751ccae3b7 (patch) | |
tree | 2a854167e59224b9fe92a2a831c5d9357921b5ba /net | |
parent | a6edc1d9085c802ab325ef577c5811c450900df3 (diff) | |
download | linux-stable-63594fd2f764c2d13bf1f71b1e73b4751ccae3b7.tar.gz linux-stable-63594fd2f764c2d13bf1f71b1e73b4751ccae3b7.tar.bz2 linux-stable-63594fd2f764c2d13bf1f71b1e73b4751ccae3b7.zip |
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')
-rw-r--r-- | net/sched/cls_tcindex.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c index 5b119efb20ee..9314a739c170 100644 --- a/net/sched/cls_tcindex.c +++ b/net/sched/cls_tcindex.c @@ -297,7 +297,7 @@ static int tcindex_alloc_perfect_hash(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; |