{"id":"CVE-2026-143043","state":"PUBLISHED","title":"smb: client: fix out-of-bounds read in dfs_parse_target_referral()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: client: fix out-of-bounds read in dfs_parse_target_referral()\n\ndfs_parse_target_referral() decides whether a prefix path remains after\nthe consumed part of full_path with:\n\n\tif (strlen(full_path) - ref->path_consumed)\n\nstrlen() returns size_t, so if path_consumed is larger than the length\nof full_path, the subtraction wraps around to a huge non-zero value.\nThe branch is then taken, prepath is set to a pointer past the\nterminating NUL of full_path, and *prepath reads out of bounds.\n\npath_consumed can exceed strlen(full_path) when the mount charset is\nnot utf8.  The referral code derives path_consumed from the canonical\npath, which is in the DFS cache charset (utf8), but it is applied here\nto full_path, which is in the mount charset.  Each non-ASCII character\nin the consumed part of the path that is longer in utf8 than in the\nmount charset makes the count too large by the difference.\n\nThis was reproduced with iocharset=iso8859-1 against a Samba DFS root\ncontaining a link named \"café\", mounting with the single Latin-1 byte\n0xe9 in the path.  On an unmodified tree such a mount fails earlier\nwith -ENOENT because the path is converted to utf8 twice in\nsetup_dfs_ref(); with that fixed (\"smb: client: fix double conversion\nof DFS path in setup_dfs_ref()\"), the mount reaches this code.\nfull_path was 29 bytes while path_consumed was 30:\n\n  BUG: KASAN: slab-out-of-bounds in dfs_parse_target_referral+0x26a/0x270\n  Read of size 1 at addr ffff88810db89d5f by task mount/1743\n  ...\n  The buggy address is located 0 bytes to the right of\n   allocated 31-byte region [ffff88810db89d40, ffff88810db89d5f)\n\nCompare path_consumed against the string length instead of subtracting,\nso that no prefix path is used when the consumed count covers the whole\nstring.  With the bounds check in place the same mount succeeds and no\nKASAN report is produced.\n\nThis only prevents the out-of-bounds access.  path_consumed is still in\nthe wrong units, so a non-ASCII link followed by a path component can\nstill produce a wrong prefix path.  That needs a separate fix.","publishedAt":"2026-12-03T09:18:19.376Z","updatedAt":"2026-12-03T09:18:19.376Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"b24002ce03cf090c5155f8597fc8dae982c33a64","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"3d6613f19f9d4308a63d3a5563badb9462bc0171","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"e35ae3edae0f72bf2135c37d7eaee48106f7a008","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"86aacc2f3f6ba18e1d87feee24f37c94b3ce863a","versionType":"git"},{"version":"0","status":"affected","lessThan":"6.12.120","versionType":"semver"},{"version":"0","status":"affected","lessThan":"6.18.66","versionType":"semver"},{"version":"0","status":"affected","lessThan":"7.3.7","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/client/dfs.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/client/dfs.c"]}],"references":["https://git.kernel.org/stable/c/b24002ce03cf090c5155f8597fc8dae982c33a64","https://git.kernel.org/stable/c/3d6613f19f9d4308a63d3a5563badb9462bc0171","https://git.kernel.org/stable/c/e35ae3edae0f72bf2135c37d7eaee48106f7a008","https://git.kernel.org/stable/c/86aacc2f3f6ba18e1d87feee24f37c94b3ce863a"],"weaknesses":[],"ingestedAt":"2026-12-03T09:26:06.073Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143043.json","commit":"9fd484e43f2e14021809e195d28c1172759faad0","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143043","state":"PUBLISHED","datePublished":"2026-12-03T09:18:19.376Z","dateUpdated":"2026-12-03T09:18:19.376Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.344Z"},"containers":{"cna":{"title":"smb: client: fix out-of-bounds read in dfs_parse_target_referral()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: client: fix out-of-bounds read in dfs_parse_target_referral()\n\ndfs_parse_target_referral() decides whether a prefix path remains after\nthe consumed part of full_path with:\n\n\tif (strlen(full_path) - ref->path_consumed)\n\nstrlen() returns size_t, so if path_consumed is larger than the length\nof full_path, the subtraction wraps around to a huge non-zero value.\nThe branch is then taken, prepath is set to a pointer past the\nterminating NUL of full_path, and *prepath reads out of bounds.\n\npath_consumed can exceed strlen(full_path) when the mount charset is\nnot utf8.  The referral code derives path_consumed from the canonical\npath, which is in the DFS cache charset (utf8), but it is applied here\nto full_path, which is in the mount charset.  Each non-ASCII character\nin the consumed part of the path that is longer in utf8 than in the\nmount charset makes the count too large by the difference.\n\nThis was reproduced with iocharset=iso8859-1 against a Samba DFS root\ncontaining a link named \"café\", mounting with the single Latin-1 byte\n0xe9 in the path.  On an unmodified tree such a mount fails earlier\nwith -ENOENT because the path is converted to utf8 twice in\nsetup_dfs_ref(); with that fixed (\"smb: client: fix double conversion\nof DFS path in setup_dfs_ref()\"), the mount reaches this code.\nfull_path was 29 bytes while path_consumed was 30:\n\n  BUG: KASAN: slab-out-of-bounds in dfs_parse_target_referral+0x26a/0x270\n  Read of size 1 at addr ffff88810db89d5f by task mount/1743\n  ...\n  The buggy address is located 0 bytes to the right of\n   allocated 31-byte region [ffff88810db89d40, ffff88810db89d5f)\n\nCompare path_consumed against the string length instead of subtracting,\nso that no prefix path is used when the consumed count covers the whole\nstring.  With the bounds check in place the same mount succeeds and no\nKASAN report is produced.\n\nThis only prevents the out-of-bounds access.  path_consumed is still in\nthe wrong units, so a non-ASCII link followed by a path component can\nstill produce a wrong prefix path.  That needs a separate fix."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"b24002ce03cf090c5155f8597fc8dae982c33a64","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"3d6613f19f9d4308a63d3a5563badb9462bc0171","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"e35ae3edae0f72bf2135c37d7eaee48106f7a008","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"86aacc2f3f6ba18e1d87feee24f37c94b3ce863a","versionType":"git"},{"version":"0","status":"affected","lessThan":"6.12.120","versionType":"semver"},{"version":"0","status":"affected","lessThan":"6.18.66","versionType":"semver"},{"version":"0","status":"affected","lessThan":"7.3.7","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/client/dfs.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/client/dfs.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/b24002ce03cf090c5155f8597fc8dae982c33a64"},{"url":"https://git.kernel.org/stable/c/3d6613f19f9d4308a63d3a5563badb9462bc0171"},{"url":"https://git.kernel.org/stable/c/e35ae3edae0f72bf2135c37d7eaee48106f7a008"},{"url":"https://git.kernel.org/stable/c/86aacc2f3f6ba18e1d87feee24f37c94b3ce863a"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:18:19.376Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}