{"id":"CVE-2026-99389","state":"PUBLISHED","title":"smb: server: size directory name conversion buffer correctly","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: server: size directory name conversion buffer correctly\n\nA 2048-byte ASCII directory name needs 4098 bytes when converted to\nUTF-16, including the terminator. ksmbd_convert_dir_info_name() caps\nits allocation at PATH_MAX and writes past the end of that buffer.\n\nAllocate space for one UTF-16 code unit per input byte plus the\nterminator. Use kmalloc_array() to check the size calculation.","publishedAt":"2026-11-19T14:23:28.576Z","updatedAt":"2026-11-22T11:08:02.840Z","severity":{"score":7.5,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","status":"affected","lessThan":"e736ee3660eac5922729a9b3c55cecd74611663c","versionType":"git"},{"version":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","status":"affected","lessThan":"93d1fbe38f0c1f230fdd24410353b1fd9e5883d3","versionType":"git"},{"version":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","status":"affected","lessThan":"c8a4c381fd68895bbb077df9b5322c8987b31cf5","versionType":"git"},{"version":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","status":"affected","lessThan":"f1f37834eaba5904103af1f18afe3510c7e9dc71","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/misc.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.15","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.61","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.2","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/misc.c"]}],"references":["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"],"weaknesses":[],"ingestedAt":"2026-11-22T11:18:06.032Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/99xxx/CVE-2026-99389.json","commit":"247cc9beefd85903834df0592e88a44f4d599223","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-99389","state":"PUBLISHED","datePublished":"2026-11-19T14:23:28.576Z","dateUpdated":"2026-11-22T11:08:02.840Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-09-25T10:25:14.412Z"},"containers":{"cna":{"title":"smb: server: size directory name conversion buffer correctly","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: server: size directory name conversion buffer correctly\n\nA 2048-byte ASCII directory name needs 4098 bytes when converted to\nUTF-16, including the terminator. ksmbd_convert_dir_info_name() caps\nits allocation at PATH_MAX and writes past the end of that buffer.\n\nAllocate space for one UTF-16 code unit per input byte plus the\nterminator. Use kmalloc_array() to check the size calculation."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","status":"affected","lessThan":"e736ee3660eac5922729a9b3c55cecd74611663c","versionType":"git"},{"version":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","status":"affected","lessThan":"93d1fbe38f0c1f230fdd24410353b1fd9e5883d3","versionType":"git"},{"version":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","status":"affected","lessThan":"c8a4c381fd68895bbb077df9b5322c8987b31cf5","versionType":"git"},{"version":"e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9","status":"affected","lessThan":"f1f37834eaba5904103af1f18afe3510c7e9dc71","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/misc.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.15","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.61","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.2","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/misc.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/e736ee3660eac5922729a9b3c55cecd74611663c"},{"url":"https://git.kernel.org/stable/c/93d1fbe38f0c1f230fdd24410353b1fd9e5883d3"},{"url":"https://git.kernel.org/stable/c/c8a4c381fd68895bbb077df9b5322c8987b31cf5"},{"url":"https://git.kernel.org/stable/c/f1f37834eaba5904103af1f18afe3510c7e9dc71"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.5,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:N - ksmbd_convert_dir_info_name() is reached from smb2_query_dir() through __query_dir() and smb2_populate_readdir_entry(). The bytes it converts are the directory entry the client previously sent as the SMB2 CREATE Name, via smb2_get_name() and smb2_creat()/ksmbd_vfs_create(), not a pre-existing on-disk structure.\nAC:H - The kmalloc is min(4*name_len, PATH_MAX), so smb_strtoUTF16() writes past it only when name_len>=2048 (2*name_len+2>4096). ext4_lookup() returns -ENAMETOOLONG above EXT4_NAME_LEN (255). The attacker cannot switch the share to a FUSE mount with fc->name_max set to FUSE_NAME_MAX.\nPR:L - smb2_check_user_session() and smb2_get_ksmbd_tcon() run before smb2_query_dir(), and planting the component requires smb2_creat() with write access on the share. That is an authenticated share user, not a pre-authentication packet and not CAP_SYS_ADMIN.\nUI:N - The same authenticated client sends the SMB2 CREATE that stores the long component and the SMB2 QUERY_DIRECTORY that converts it. No other user has to mount media or open a file.\nS:U - The out-of-bounds store is in the ksmbd worker's kernel heap and yields host kernel privilege. It does not cross a guest-to-host or IOMMU boundary.\nC:H - With a PATH_MAX-1 component, smb_strtoUTF16() writes 2*name_len+2 bytes (8192) into the 4096-byte buffer in ksmbd_convert_dir_info_name(). Corrupting adjacent slab objects is enough to build a kernel memory disclosure.\nI:H - The bytes written past that buffer are the UTF-16 form of the attacker-chosen SMB2 CREATE name, and the client picks the length. That heap out-of-bounds write can overwrite neighboring objects and control data.\nA:H - A 2048-byte ASCII name writes the terminating UTF-16 NUL two bytes past the PATH_MAX allocation and oopses the ksmbd thread. A longer accepted name smashes a full neighboring page."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-22T11:08:02.840Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.12.117"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.18.61"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"7.3.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}