{"id":"CVE-2026-99385","aliases":["CVE-2026-99385"],"related":[],"kind":"vulnerability","state":"published","title":"smb: client: fix buffer overflow in SMB2_tcon()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: client: fix buffer overflow in SMB2_tcon()\n\nIn SMB2_tcon(), unc_path is allocated with a fixed buffer size of\nMAX_SHARENAME_LENGTH * 2 bytes (672 bytes). However, the user-controlled\nUNC path (tree) length is passed to cifs_strtoUTF16(), which assumes the\ndestination buffer is large enough and writes strlen(tree) + 1 UTF-16 code\nunits.\n\nCommit 62a1a439e0fd (\"cifs: clean up handling of unc= option\") removed the\nlength check on UNC mount options, allowing mount paths to exceed\nMAX_SHARENAME_LENGTH while retaining the fixed-size buffer allocation in\nSMB2_tcon(). Consequently, an oversized UNC string causes cifs_strtoUTF16()\nto write past the end of the heap object, resulting in a slab-out-of-bounds\nwrite. Furthermore, if a tree exceeds MAX_TREE_SIZE characters, strscpy()\ntruncates it in cifs_tcon::tree_name, causing subsequent reconnects or\nfailovers to fail.\n\nFix this by first verifying that the length of tree does not exceed\nMAX_TREE_SIZE, returning -EINVAL if it does. Then, dynamically allocate\nunc_path based on the length of tree so that it safely accommodates all\nUTF-16 code units for paths within MAX_TREE_SIZE.\n\n[pc: remove unused MAX_SHARENAME_LENGTH]","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: client: fix buffer overflow in SMB2_tcon()\n\nIn SMB2_tcon(), unc_path is allocated with a fixed buffer size of\nMAX_SHARENAME_LENGTH * 2 bytes (672 bytes). However, the user-controlled\nUNC path (tree) length is passed to cifs_strtoUTF16(), which assumes the\ndestination buffer is large enough and writes strlen(tree) + 1 UTF-16 code\nunits.\n\nCommit 62a1a439e0fd (\"cifs: clean up handling of unc= option\") removed the\nlength check on UNC mount options, allowing mount paths to exceed\nMAX_SHARENAME_LENGTH while retaining the fixed-size buffer allocation in\nSMB2_tcon(). Consequently, an oversized UNC string causes cifs_strtoUTF16()\nto write past the end of the heap object, resulting in a slab-out-of-bounds\nwrite. Furthermore, if a tree exceeds MAX_TREE_SIZE characters, strscpy()\ntruncates it in cifs_tcon::tree_name, causing subsequent reconnects or\nfailovers to fail.\n\nFix this by first verifying that the length of tree does not exceed\nMAX_TREE_SIZE, returning -EINVAL if it does. Then, dynamically allocate\nunc_path based on the length of tree so that it safely accommodates all\nUTF-16 code units for paths within MAX_TREE_SIZE.\n\n[pc: remove unused MAX_SHARENAME_LENGTH]","source":"cvelist"}],"published":"2026-11-19T14:23:25.254Z","modified":"2026-11-23T08:17:43.107Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"62a1a439e0fdd4ec8a80dc00fcbb9f26b5c34de1","fixed":"a4e022f375a04cadca3f799f6157877961be5829","status":"affected"},{"type":"git","introduced":"62a1a439e0fdd4ec8a80dc00fcbb9f26b5c34de1","fixed":"e17fe5c8bf3fca4852e497b7061e316d314d7c52","status":"affected"},{"type":"git","introduced":"62a1a439e0fdd4ec8a80dc00fcbb9f26b5c34de1","fixed":"85692a261042bab56fdfd51e10630f09ef5a5082","status":"affected"},{"type":"git","introduced":"62a1a439e0fdd4ec8a80dc00fcbb9f26b5c34de1","fixed":"0149377b312eeb136119223a7c05d55c4b24c76d","status":"affected"},{"type":"git","introduced":"62a1a439e0fdd4ec8a80dc00fcbb9f26b5c34de1","fixed":"75fd4c72aa3dcfabb318144636f416be6796d423","status":"affected"},{"type":"git","introduced":"62a1a439e0fdd4ec8a80dc00fcbb9f26b5c34de1","fixed":"acf25a7be39dccdbf60fdf3d437dd7832fa4b6d3","status":"affected"},{"type":"git","introduced":"62a1a439e0fdd4ec8a80dc00fcbb9f26b5c34de1","fixed":"d26f7fbca42532c6c79efdceb4bd5198e1849314","status":"affected"},{"type":"git","introduced":"62a1a439e0fdd4ec8a80dc00fcbb9f26b5c34de1","fixed":"73cc469b0ff7551f8537ea919709973e6dc4f514","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"3.8","status":"affected"},{"type":"semver","introduced":"0","fixed":"3.8","status":"unaffected"},{"type":"semver","introduced":"5.10.275","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.226","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.193","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.117","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.61","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.2","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/a4e022f375a04cadca3f799f6157877961be5829","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e17fe5c8bf3fca4852e497b7061e316d314d7c52","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/85692a261042bab56fdfd51e10630f09ef5a5082","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0149377b312eeb136119223a7c05d55c4b24c76d","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/75fd4c72aa3dcfabb318144636f416be6796d423","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/acf25a7be39dccdbf60fdf3d437dd7832fa4b6d3","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d26f7fbca42532c6c79efdceb4bd5198e1849314","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/73cc469b0ff7551f8537ea919709973e6dc4f514","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-99385","url":"https://www.cve.org/CVERecord?id=CVE-2026-99385","licence":"CVE Terms of Use","modified":"2026-11-23T08:02:12.488Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-99385","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99385","licence":"Public domain","modified":"2026-11-23T08:17:43.107Z"}],"updatedAt":"2026-11-25T22:59:52.052Z","epss":{"score":0.00863,"percentile":0.59666,"date":"2026-12-01T12:00:22.000Z"}}