Subject: CVE-2024-46833: net: hns3: void array out of bound when loop tnl_num

From: Greg Kroah-Hartman <[email-masked]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

net: hns3: void array out of bound when loop tnl_num

When query reg inf of SSU, it loops tnl_num times. However, tnl_num comes
from hardware and the length of array is a fixed value. To void array out
of bound, make sure the loop time is not greater than the length of array

The Linux kernel CVE team has assigned CVE-2024-46833 to this issue.

Affected and fixed versions
===========================

	Fixed in 6.10.10 with commit c33a9806dc80
	Fixed in 6.11 with commit 86db7bfb0670

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2024-46833
will be updated if fixes are backported, please check that for the most
up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
	drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/c33a9806dc806bcb4a31dc71fb06979219181ad4
	https://git.kernel.org/stable/c/86db7bfb06704ef17340eeae71c832f21cfce35c