CVE-2024-56546: drivers: soc: xilinx: add the missing kfree in xlnx_add_cb_for_suspend()
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
drivers: soc: xilinx: add the missing kfree in xlnx_add_cb_for_suspend()
If we fail to allocate memory for cb_data by kmalloc, the memory allocation for eve_data is never freed, add the missing kfree() in the error handling path.
The Linux kernel CVE team has assigned CVE-2024-56546 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.19 with commit 05e5ba40ea7ab6a99bb8d6117c899d0e13ca8700 and fixed in 6.1.120 with commit 272168927f38bda46f6c1ed5f40de97689e7a5d2 Issue introduced in 5.19 with commit 05e5ba40ea7ab6a99bb8d6117c899d0e13ca8700 and fixed in 6.6.64 with commit 882d7afaa4b82c20a7be7a3a039532a80ebacd23 Issue introduced in 5.19 with commit 05e5ba40ea7ab6a99bb8d6117c899d0e13ca8700 and fixed in 6.11.11 with commit 5a3bda42394ff137eb2d3d3d20d2956a8c6e9237 Issue introduced in 5.19 with commit 05e5ba40ea7ab6a99bb8d6117c899d0e13ca8700 and fixed in 6.12.2 with commit 584d420771e1ad2bb74e19a19da8ae0fee0a6e1f Issue introduced in 5.19 with commit 05e5ba40ea7ab6a99bb8d6117c899d0e13ca8700 and fixed in 6.13-rc1 with commit 44ed4f90a97ff6f339e50ac01db71544e0990efc
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-56546
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/soc/xilinx/xlnx_event_manager.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/272168927f38bda46f6c1ed5f40de97689e7a5d2 https://git.kernel.org/stable/c/882d7afaa4b82c20a7be7a3a039532a80ebacd23 https://git.kernel.org/stable/c/5a3bda42394ff137eb2d3d3d20d2956a8c6e9237 https://git.kernel.org/stable/c/584d420771e1ad2bb74e19a19da8ae0fee0a6e1f https://git.kernel.org/stable/c/44ed4f90a97ff6f339e50ac01db71544e0990efc