{"id":"CVE-2026-139258","state":"PUBLISHED","title":"ntfs: widen the sub-block offsets in ntfs_decompress()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nntfs: widen the sub-block offsets in ntfs_decompress()\n\nntfs_decompress() tracks where the current sub-block starts and ends\ninside the destination page with two u16s:\n\n\tu16 do_sb_start;\n\tu16 do_sb_end;\n\t...\n\tdo_sb_start = *dest_ofs;\n\tdo_sb_end = do_sb_start + NTFS_SB_SIZE;\n\n*dest_ofs is an int page offset masked with ~PAGE_MASK, and\nNTFS_SB_SIZE is 0x1000, so do_sb_end needs PAGE_SIZE + 0xfff of range.\nThat exceeds u16 once PAGE_SIZE reaches 0x10000: the last sub-block of a\npage starts at 0xf000 and do_sb_end wraps from 0x10000 to 0.\n\nThe zero-fill that pads a short sub-block then computes a negative\nlength:\n\n\tif (dp_addr < dp_sb_end) {\n\t\tint nr_bytes = do_sb_end - *dest_ofs;\n\n\t\tmemset(dp_addr, 0, nr_bytes);\n\nA sub-block made only of symbol tokens reaches this without consulting\ndo_sb_end on the way, because that path just does\n\n\t*dp_addr++ = *cb++;\n\t++*dest_ofs;\n\nand is bounded by dp_addr against dp_sb_end.  With do_sb_start at 0xf000\nand eight literal bytes emitted, nr_bytes is -61448 and the memset()\nruns for 18446744073709490168 bytes.\n\nGetting there is cheap: fifteen sub-blocks of eleven bytes each advance\n*dest_ofs to 0xf000, since the same zero-fill pads each of them out to\n0x1000 while do_sb_end is still exact, and the sixteenth one triggers\nthe wrap.  A compression block is 0x10000 bytes with 4 KiB clusters and\nthe fixed compression unit of 4, so all sixteen fit with room to spare.\n\nPhrase tokens are bounded against do_sb_end and so return -EOVERFLOW\ninstead, and the\n\n\tif (*dest_index == dest_max_index && do_sb_end > dest_max_ofs)\n\ncheck at the top of the sub-block stops firing for the same reason.\n\nUse int for both, matching *dest_ofs and dest_max_ofs.  The narrow type\ncame in with the original import and survived the removal and revert of\nthe driver.","publishedAt":"2026-11-30T13:33:05.006Z","updatedAt":"2026-11-30T13:33:05.006Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1e9ea7e04472d4e5e12e58c881eaacfb3e49b669","status":"affected","lessThan":"389ab01cff8a352c46cb137ef382d5eab4c0bbf9","versionType":"git"},{"version":"1e9ea7e04472d4e5e12e58c881eaacfb3e49b669","status":"affected","lessThan":"d45f99f816c9e40cf89b93b90396b1503eda1e47","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ntfs/compress.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.1","status":"affected"},{"version":"0","status":"unaffected","lessThan":"7.1","versionType":"semver"},{"version":"7.3.6","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/ntfs/compress.c"]}],"references":["https://git.kernel.org/stable/c/389ab01cff8a352c46cb137ef382d5eab4c0bbf9","https://git.kernel.org/stable/c/d45f99f816c9e40cf89b93b90396b1503eda1e47"],"weaknesses":[],"ingestedAt":"2026-11-30T13:46:04.484Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139258.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139258","state":"PUBLISHED","datePublished":"2026-11-30T13:33:05.006Z","dateUpdated":"2026-11-30T13:33:05.006Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.923Z"},"containers":{"cna":{"title":"ntfs: widen the sub-block offsets in ntfs_decompress()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nntfs: widen the sub-block offsets in ntfs_decompress()\n\nntfs_decompress() tracks where the current sub-block starts and ends\ninside the destination page with two u16s:\n\n\tu16 do_sb_start;\n\tu16 do_sb_end;\n\t...\n\tdo_sb_start = *dest_ofs;\n\tdo_sb_end = do_sb_start + NTFS_SB_SIZE;\n\n*dest_ofs is an int page offset masked with ~PAGE_MASK, and\nNTFS_SB_SIZE is 0x1000, so do_sb_end needs PAGE_SIZE + 0xfff of range.\nThat exceeds u16 once PAGE_SIZE reaches 0x10000: the last sub-block of a\npage starts at 0xf000 and do_sb_end wraps from 0x10000 to 0.\n\nThe zero-fill that pads a short sub-block then computes a negative\nlength:\n\n\tif (dp_addr < dp_sb_end) {\n\t\tint nr_bytes = do_sb_end - *dest_ofs;\n\n\t\tmemset(dp_addr, 0, nr_bytes);\n\nA sub-block made only of symbol tokens reaches this without consulting\ndo_sb_end on the way, because that path just does\n\n\t*dp_addr++ = *cb++;\n\t++*dest_ofs;\n\nand is bounded by dp_addr against dp_sb_end.  With do_sb_start at 0xf000\nand eight literal bytes emitted, nr_bytes is -61448 and the memset()\nruns for 18446744073709490168 bytes.\n\nGetting there is cheap: fifteen sub-blocks of eleven bytes each advance\n*dest_ofs to 0xf000, since the same zero-fill pads each of them out to\n0x1000 while do_sb_end is still exact, and the sixteenth one triggers\nthe wrap.  A compression block is 0x10000 bytes with 4 KiB clusters and\nthe fixed compression unit of 4, so all sixteen fit with room to spare.\n\nPhrase tokens are bounded against do_sb_end and so return -EOVERFLOW\ninstead, and the\n\n\tif (*dest_index == dest_max_index && do_sb_end > dest_max_ofs)\n\ncheck at the top of the sub-block stops firing for the same reason.\n\nUse int for both, matching *dest_ofs and dest_max_ofs.  The narrow type\ncame in with the original import and survived the removal and revert of\nthe driver."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1e9ea7e04472d4e5e12e58c881eaacfb3e49b669","status":"affected","lessThan":"389ab01cff8a352c46cb137ef382d5eab4c0bbf9","versionType":"git"},{"version":"1e9ea7e04472d4e5e12e58c881eaacfb3e49b669","status":"affected","lessThan":"d45f99f816c9e40cf89b93b90396b1503eda1e47","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ntfs/compress.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.1","status":"affected"},{"version":"0","status":"unaffected","lessThan":"7.1","versionType":"semver"},{"version":"7.3.6","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/ntfs/compress.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/389ab01cff8a352c46cb137ef382d5eab4c0bbf9"},{"url":"https://git.kernel.org/stable/c/d45f99f816c9e40cf89b93b90396b1503eda1e47"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:33:05.006Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.1","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.1","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}