CVE-2025-40286: smb/server: fix possible memory leak in smb2_read()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
smb/server: fix possible memory leak in smb2_read()
Memory leak occurs when ksmbd_vfs_read() fails.
Fix this by adding the missing kvfree().
The Linux kernel CVE team has assigned CVE-2025-40286 to this issue.
Affected and fixed versions
===========================
Fixed in 6.1.159 with commit 0797c6cf3b857cc229ab2bc69552938dcd738d78 Fixed in 6.6.117 with commit 63d8706a2c09a0c29b8b0e8a44bc7a1339685de9 Fixed in 6.12.59 with commit f1305587731886da37a214cda812ade246c653b0 Fixed in 6.17.9 with commit bfda5422a16651d0bf864ec468b1c216e1b10d91 Fixed in 6.18 with commit 6fced056d2cc8d01b326e6fcfabaacb9850b71a4
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-2025-40286
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/server/smb2pdu.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/0797c6cf3b857cc229ab2bc69552938dcd738d78 https://git.kernel.org/stable/c/63d8706a2c09a0c29b8b0e8a44bc7a1339685de9 https://git.kernel.org/stable/c/f1305587731886da37a214cda812ade246c653b0 https://git.kernel.org/stable/c/bfda5422a16651d0bf864ec468b1c216e1b10d91 https://git.kernel.org/stable/c/6fced056d2cc8d01b326e6fcfabaacb9850b71a4