CVE-2024-53202: firmware_loader: Fix possible resource leak in fw_log_firmware_info()
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
firmware_loader: Fix possible resource leak in fw_log_firmware_info()
The alg instance should be released under the exception path, otherwise there may be resource leak here.
To mitigate this, free the alg instance with crypto_free_shash when kmalloc fails.
The Linux kernel CVE team has assigned CVE-2024-53202 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.4 with commit 02fe26f25325b547b7a31a65deb0326c04bb5174 and fixed in 6.6.64 with commit 789a72498d32f88d24371c10985aceb46397056c Issue introduced in 6.4 with commit 02fe26f25325b547b7a31a65deb0326c04bb5174 and fixed in 6.11.11 with commit eb5d67d00ad17a5bd0920f455160dc2ccbd2dc78 Issue introduced in 6.4 with commit 02fe26f25325b547b7a31a65deb0326c04bb5174 and fixed in 6.12.2 with commit f380f895dbb2a11d62ca6df9e82d995f4bc26b84 Issue introduced in 6.4 with commit 02fe26f25325b547b7a31a65deb0326c04bb5174 and fixed in 6.13-rc1 with commit 369a9c046c2fdfe037f05b43b84c386bdbccc103
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-53202
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/base/firmware_loader/main.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/789a72498d32f88d24371c10985aceb46397056c https://git.kernel.org/stable/c/eb5d67d00ad17a5bd0920f455160dc2ccbd2dc78 https://git.kernel.org/stable/c/f380f895dbb2a11d62ca6df9e82d995f4bc26b84 https://git.kernel.org/stable/c/369a9c046c2fdfe037f05b43b84c386bdbccc103