net: hns3: check queue id range before using
authorYufeng Mo <moyufeng@huawei.com>
Wed, 15 Sep 2021 13:52:09 +0000 (21:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Sep 2021 08:11:02 +0000 (10:11 +0200)
commit4e0fd1d79534f830e247f85db0f0531fcd9d3f82
tree2bbfa613328632fffea9d68477c6af9d9abc50de
parentca435999bcaf572a85b369a13982928c7ca2e335
net: hns3: check queue id range before using

[ Upstream commit 63b1279d9905100a14da9e043de7b28e99dba3f8 ]

The input parameters may not be reliable. Before using the
queue id, we should check this parameter. Otherwise, memory
overwriting may occur.

Fixes: d34100184685 ("net: hns3: refactor the mailbox message between PF and VF")
Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c