]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: hns3: fix out-of-bounds access may occur when coalesce info is read via debugfs
authorYonglong Liu <liuyonglong@huawei.com>
Fri, 10 Nov 2023 09:37:10 +0000 (17:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:14:54 +0000 (17:14 +0000)
commitbe1f703f39efa27b7371b9a4cd983317f1366792
tree043b93cb2afe7e24c2fddea7ddbf1c46d967328d
parent3a948d0aed3de9d74f5c625dc1298c3e6f8176c3
net: hns3: fix out-of-bounds access may occur when coalesce info is read via debugfs

[ Upstream commit 53aba458f23846112c0d44239580ff59bc5c36c3 ]

The hns3 driver define an array of string to show the coalesce
info, but if the kernel adds a new mode or a new state,
out-of-bounds access may occur when coalesce info is read via
debugfs, this patch fix the problem.

Fixes: c99fead7cb07 ("net: hns3: add debugfs support for interrupt coalesce")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c