]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: fix warning in tcindex_alloc_perfect_hash
authorPavel Skripkin <paskripkin@gmail.com>
Fri, 25 Jun 2021 20:23:48 +0000 (23:23 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jun 2021 20:03:29 +0000 (13:03 -0700)
commit55f9e6414a1586caa46268c108429ff667044e1f
treeb775cc1ed9b56b0744fa9e4b0cce447a9a4ed628
parent6a27c55369e5f6c5472da36e540e59c0eaee2020
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: 6a2fa3446e17 ("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>
net/sched/cls_tcindex.c