Executive brief
A vulnerability was identified in the Linux kernel's SMB server component (ksmbd), which is used to share files over a network. A local attacker could send a specially crafted message to the server to trigger an unauthorized memory read. This could lead to a system crash or the exposure of sensitive information from the computer's memory.
Technical details
An out-of-bounds read vulnerability exists in the ksmbd SMB server in the Linux kernel, specifically within the handle_response() function in fs/smb/server/transport_ipc.c. The function dereferences a 4-byte handle from the IPC payload without first verifying that the payload size (sz) is at least 4 bytes. A local attacker or a compromised ksmbd.mountd process could provide a truncated message, causing the kernel to read 4 bytes beyond the allocated buffer. This flaw can be exploited to leak kernel memory or cause a kernel oops (denial of service). The issue has been resolved by adding a size validation check before the handle is dereferenced.
Affected products
- Linux Linux Kernel 5.15 to 6.17.6
Timeline
- 2025-10-22: disclosed: Vulnerability reported by Qianchang Zhao
- 2025-10-29: patched: Fixes committed to stable kernel branches
- 2025-10-29: advisory: CVE-2025-40084 published
References
- https://git.kernel.org/stable/c/2dc125f5da134c0915a840b62565c60a595673dd
- https://git.kernel.org/stable/c/6f40e50ceb99fc8ef37e5c56e2ec1d162733fef0
- https://git.kernel.org/stable/c/867ffd9d67285612da3f0498ca618297f8e41f01
- https://git.kernel.org/stable/c/898d527ed94c19980a4d848f10057f1fed578ffb
- https://git.kernel.org/stable/c/a02e432d5130da4c723aabe1205bac805889fdb2