]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: add input length check for debugfs write function
authorYufeng Mo <moyufeng@huawei.com>
Fri, 9 Aug 2019 02:31:10 +0000 (10:31 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Aug 2019 20:44:32 +0000 (13:44 -0700)
commit2abd75d87c58af5e812dfc7c5a330075a2e358a7
treecc21fc48b5180a8cf6b8bcd8a9b4b6ee56514631
parent54e41bc167fd820a250a9f26e6b2f42cddcb2479
net: hns3: add input length check for debugfs write function

If the input length reaches the maximum value of size_t, the reverse is
triggered when 1 is added. In addition, there is no need to have such a
large length. Therefore, the input length should be checked and the value
should be less than or equal to 1024.

Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Reviewed-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c