| From bippy-5f407fcff5a0 Mon Sep 17 00:00:00 2001 |
| From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| To: <linux-cve-announce@vger.kernel.org> |
| Reply-to: <cve@kernel.org>, <linux-kernel@vger.kernel.org> |
| Subject: CVE-2024-50152: smb: client: fix possible double free in smb2_set_ea() |
| |
| Description |
| =========== |
| |
| In the Linux kernel, the following vulnerability has been resolved: |
| |
| smb: client: fix possible double free in smb2_set_ea() |
| |
| Clang static checker(scan-build) warning: |
| fs/smb/client/smb2ops.c:1304:2: Attempt to free released memory. |
| 1304 | kfree(ea); |
| | ^~~~~~~~~ |
| |
| There is a double free in such case: |
| 'ea is initialized to NULL' -> 'first successful memory allocation for |
| ea' -> 'something failed, goto sea_exit' -> 'first memory release for ea' |
| -> 'goto replay_again' -> 'second goto sea_exit before allocate memory |
| for ea' -> 'second memory release for ea resulted in double free'. |
| |
| Re-initialie 'ea' to NULL near to the replay_again label, it can fix this |
| double free problem. |
| |
| The Linux kernel CVE team has assigned CVE-2024-50152 to this issue. |
| |
| |
| Affected and fixed versions |
| =========================== |
| |
| Issue introduced in 6.6.32 with commit 433042a91f9373241307725b52de573933ffedbf and fixed in 6.6.59 with commit b1813c220b76f60b1727984794377c4aa849d4c1 |
| Issue introduced in 6.8 with commit 4f1fffa2376922f3d1d506e49c0fd445b023a28e and fixed in 6.11.6 with commit c9f758ecf2562dfdd4adf12c22921b5de8366123 |
| Issue introduced in 6.8 with commit 4f1fffa2376922f3d1d506e49c0fd445b023a28e and fixed in 6.12 with commit 19ebc1e6cab334a8193398d4152deb76019b5d34 |
| |
| 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-50152 |
| 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: |
| fs/smb/client/smb2ops.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/b1813c220b76f60b1727984794377c4aa849d4c1 |
| https://git.kernel.org/stable/c/c9f758ecf2562dfdd4adf12c22921b5de8366123 |
| https://git.kernel.org/stable/c/19ebc1e6cab334a8193398d4152deb76019b5d34 |