{"id":"CVE-2026-139262","state":"PUBLISHED","title":"ntfs: restart the zone search when the allocation hint fails","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nntfs: restart the zone search when the allocation hint fails\n\nWhen ntfs_cluster_alloc() is given a start_lcn, it first tries the\nclusters from there on.  If that does not satisfy the request, it moves\non to the zone's current position, but keeps the pass, the zone_end and\nthe has_guess state it had.  That loses free clusters in two ways.  If\nthe search had already moved on to pass 2, whose range ends at the hint,\nit scans only from the zone position to the hint and misses every free\ncluster between the start of the zone and the zone position.  If no\ncluster had been tested yet, has_guess is still set, so the cluster at\nthe zone position is tried as if it had been the hint, and when that\ncluster is in use the rest of the bitmap buffer is skipped.\n\nBoth happen when the hint lies at or past the end of the volume, which\nntfs_attr_map_cluster() produces when it extrapolates from the last\nallocated run across a hole.  The allocator then finds nothing, shrinks\nthe MFT zone to nothing trying to satisfy the request, and fails with\n-ENOSPC.\n\nTo reproduce on a 128 MiB volume with 4 KiB clusters, extend two files\nin turn by one cluster at a time, alternating between fallocate(),\nwrite() past EOF and truncate() up, so that the runs of each file are\nseparated by holes.  When the volume is full, truncate both files back\nto 1 MiB and start again.  During the second round a one-cluster\nfallocate() fails with ENOSPC while 40 MiB is free.\n\nStart the zone over as if no hint had been given.  A contiguous request\ncan get there with the run from the hint already allocated, when that\nrun reached the end of a bitmap buffer or of the zone.  Return that run\ninstead, as when a cluster in use ends it; going on at the zone position\ngives the request a second run that its caller does not expect.  That\ncould happen before this patch too, whenever the cluster at the zone\nposition was free.  ntfs_attr_map_cluster() reports and zeroes only the\nfirst run, so after a fallocate() of 20 clusters over a hole, with the\nhint 4 clusters before the end of the volume, 16 of them read back the\ndata of a deleted file.","publishedAt":"2026-11-30T13:33:07.199Z","updatedAt":"2026-11-30T13:33:07.199Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"11ccc9107dc460de28af90fac1f42404d9802735","status":"affected","lessThan":"52df8c5fb224ce77c01a6045ed6038e0605296a2","versionType":"git"},{"version":"11ccc9107dc460de28af90fac1f42404d9802735","status":"affected","lessThan":"18d4d2a3ce756af690a620a5199616ce2611c2c9","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ntfs/lcnalloc.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/lcnalloc.c"]}],"references":["https://git.kernel.org/stable/c/52df8c5fb224ce77c01a6045ed6038e0605296a2","https://git.kernel.org/stable/c/18d4d2a3ce756af690a620a5199616ce2611c2c9"],"weaknesses":[],"ingestedAt":"2026-11-30T13:46:04.484Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139262.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139262","state":"PUBLISHED","datePublished":"2026-11-30T13:33:07.199Z","dateUpdated":"2026-11-30T13:33:07.199Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.923Z"},"containers":{"cna":{"title":"ntfs: restart the zone search when the allocation hint fails","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nntfs: restart the zone search when the allocation hint fails\n\nWhen ntfs_cluster_alloc() is given a start_lcn, it first tries the\nclusters from there on.  If that does not satisfy the request, it moves\non to the zone's current position, but keeps the pass, the zone_end and\nthe has_guess state it had.  That loses free clusters in two ways.  If\nthe search had already moved on to pass 2, whose range ends at the hint,\nit scans only from the zone position to the hint and misses every free\ncluster between the start of the zone and the zone position.  If no\ncluster had been tested yet, has_guess is still set, so the cluster at\nthe zone position is tried as if it had been the hint, and when that\ncluster is in use the rest of the bitmap buffer is skipped.\n\nBoth happen when the hint lies at or past the end of the volume, which\nntfs_attr_map_cluster() produces when it extrapolates from the last\nallocated run across a hole.  The allocator then finds nothing, shrinks\nthe MFT zone to nothing trying to satisfy the request, and fails with\n-ENOSPC.\n\nTo reproduce on a 128 MiB volume with 4 KiB clusters, extend two files\nin turn by one cluster at a time, alternating between fallocate(),\nwrite() past EOF and truncate() up, so that the runs of each file are\nseparated by holes.  When the volume is full, truncate both files back\nto 1 MiB and start again.  During the second round a one-cluster\nfallocate() fails with ENOSPC while 40 MiB is free.\n\nStart the zone over as if no hint had been given.  A contiguous request\ncan get there with the run from the hint already allocated, when that\nrun reached the end of a bitmap buffer or of the zone.  Return that run\ninstead, as when a cluster in use ends it; going on at the zone position\ngives the request a second run that its caller does not expect.  That\ncould happen before this patch too, whenever the cluster at the zone\nposition was free.  ntfs_attr_map_cluster() reports and zeroes only the\nfirst run, so after a fallocate() of 20 clusters over a hole, with the\nhint 4 clusters before the end of the volume, 16 of them read back the\ndata of a deleted file."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"11ccc9107dc460de28af90fac1f42404d9802735","status":"affected","lessThan":"52df8c5fb224ce77c01a6045ed6038e0605296a2","versionType":"git"},{"version":"11ccc9107dc460de28af90fac1f42404d9802735","status":"affected","lessThan":"18d4d2a3ce756af690a620a5199616ce2611c2c9","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ntfs/lcnalloc.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/lcnalloc.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/52df8c5fb224ce77c01a6045ed6038e0605296a2"},{"url":"https://git.kernel.org/stable/c/18d4d2a3ce756af690a620a5199616ce2611c2c9"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:33:07.199Z"},"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"}}}}}