CVE-2023-53195: mlxsw: minimal: fix potential memory leak in mlxsw_m_linecards_init
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
mlxsw: minimal: fix potential memory leak in mlxsw_m_linecards_init
The line cards array is not freed in the error path of mlxsw_m_linecards_init(), which can lead to a memory leak. Fix by freeing the array in the error path, thereby making the error path identical to mlxsw_m_linecards_fini().
The Linux kernel CVE team has assigned CVE-2023-53195 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.1 with commit 01328e23a476a47179b07125eabac439bc1d5fd3 and fixed in 6.1.39 with commit d4f5b1dd816dccd4ee6bb60b2a81a3d4373636a9 Issue introduced in 6.1 with commit 01328e23a476a47179b07125eabac439bc1d5fd3 and fixed in 6.4.4 with commit cd716022c968bc6748f23708b986f845b45791b7 Issue introduced in 6.1 with commit 01328e23a476a47179b07125eabac439bc1d5fd3 and fixed in 6.5 with commit 08fc75735fda3be97194bfbf3c899c87abb3d0fe
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-2023-53195
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/mellanox/mlxsw/minimal.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/d4f5b1dd816dccd4ee6bb60b2a81a3d4373636a9 https://git.kernel.org/stable/c/cd716022c968bc6748f23708b986f845b45791b7 https://git.kernel.org/stable/c/08fc75735fda3be97194bfbf3c899c87abb3d0fe