CVE-2023-53546: net/mlx5: DR, fix memory leak in mlx5dr_cmd_create_reformat_ctx
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
net/mlx5: DR, fix memory leak in mlx5dr_cmd_create_reformat_ctx
when mlx5_cmd_exec failed in mlx5dr_cmd_create_reformat_ctx, the memory pointed by 'in' is not released, which will cause memory leak. Move memory release after mlx5_cmd_exec.
The Linux kernel CVE team has assigned CVE-2023-53546 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.4 with commit 1d9186476e12c85dc81a0f01f5c614a9683af7f2 and fixed in 5.4.253 with commit 800d8c96bf997da5eb76ccf8d88795c4231c83fb Issue introduced in 5.4 with commit 1d9186476e12c85dc81a0f01f5c614a9683af7f2 and fixed in 5.10.190 with commit 165159854757dbae0dfd1812b27051da35aa6223 Issue introduced in 5.4 with commit 1d9186476e12c85dc81a0f01f5c614a9683af7f2 and fixed in 5.15.126 with commit 00cecb0a8f9e7a21754d5ad85813ab6b47b3308f Issue introduced in 5.4 with commit 1d9186476e12c85dc81a0f01f5c614a9683af7f2 and fixed in 6.1.45 with commit 3169c3854397f3070a63b1b772db16dcb8cba7b4 Issue introduced in 5.4 with commit 1d9186476e12c85dc81a0f01f5c614a9683af7f2 and fixed in 6.4.10 with commit 622d71d99124e69f7bf2e2b7a89f5f444a24d235 Issue introduced in 5.4 with commit 1d9186476e12c85dc81a0f01f5c614a9683af7f2 and fixed in 6.5 with commit 5dd77585dd9d0e03dd1bceb95f0269a7eaf6b936
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-53546
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/mlx5/core/steering/dr_cmd.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/800d8c96bf997da5eb76ccf8d88795c4231c83fb https://git.kernel.org/stable/c/165159854757dbae0dfd1812b27051da35aa6223 https://git.kernel.org/stable/c/00cecb0a8f9e7a21754d5ad85813ab6b47b3308f https://git.kernel.org/stable/c/3169c3854397f3070a63b1b772db16dcb8cba7b4 https://git.kernel.org/stable/c/622d71d99124e69f7bf2e2b7a89f5f444a24d235 https://git.kernel.org/stable/c/5dd77585dd9d0e03dd1bceb95f0269a7eaf6b936