From: GuoJia Liao liaoguojia@huawei.com
driver inclusion category: bugfix bugzilla: NA CVE: NA
----------------------------
Parameter 'vf_id' used for receiving the vf id from external input. It's assigned as 'int'. However, when using kstrtouint(), there is a mismatch type between 'int' to 'unsigned int', causing a risk of negetive numbers to an unsigned int.
definition of kstrtouint() as below: int kstrtouint ( const char * s, unsigned int base, unsigned int * res);
Fixes: f3b9739ecaad ("net: hns3: add dumping vlan filter config in debugfs")
Signed-off-by: GuoJia Liao liaoguojia@huawei.com Reviewed-by: Peng Li lipeng321@huawei.com Reviewed-by: Weiwei Deng dengweiwei@huawei.com Reviewed-by: Zhaohui Zhong zhongzhaohui@huawei.com Reviewed-by: Junxin Chen chenjunxin1@huawei.com Signed-off-by: Shengzui You youshengzui@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c index 5190212922a0..fd5cfb1e6311 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c @@ -1622,7 +1622,7 @@ static void hclge_dbg_dump_vlan_filter(struct hclge_dev *hdev, struct hclge_vport *vport; struct hclge_desc desc; bool has_vlan_used; - int vf_id; + u32 vf_id; int ret;
ret = kstrtouint(cmd_buf, 0, &vf_id);