CVE-2026-99389: smb: server: size directory name conversion buffer correctly
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
smb: server: size directory name conversion buffer correctly
A 2048-byte ASCII directory name needs 4098 bytes when converted to UTF-16, including the terminator. ksmbd_convert_dir_info_name() caps its allocation at PATH_MAX and writes past the end of that buffer.
Allocate space for one UTF-16 code unit per input byte plus the terminator. Use kmalloc_array() to check the size calculation.
The Linux kernel CVE team has assigned CVE-2026-99389 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.15 with commit e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 and fixed in 6.12.117 with commit e736ee3660eac5922729a9b3c55cecd74611663c Issue introduced in 5.15 with commit e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 and fixed in 6.18.61 with commit 93d1fbe38f0c1f230fdd24410353b1fd9e5883d3 Issue introduced in 5.15 with commit e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 and fixed in 7.3.2 with commit c8a4c381fd68895bbb077df9b5322c8987b31cf5 Issue introduced in 5.15 with commit e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 and fixed in 7.4-rc1 with commit f1f37834eaba5904103af1f18afe3510c7e9dc71
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-2026-99389
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/misc.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/e736ee3660eac5922729a9b3c55cecd74611663c https://git.kernel.org/stable/c/93d1fbe38f0c1f230fdd24410353b1fd9e5883d3 https://git.kernel.org/stable/c/c8a4c381fd68895bbb077df9b5322c8987b31cf5 https://git.kernel.org/stable/c/f1f37834eaba5904103af1f18afe3510c7e9dc71