{"id":"CVE-2026-139162","state":"PUBLISHED","title":"fs/ntfs3: handle partial allocation in attr_data_get_block_locked()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs/ntfs3: handle partial allocation in attr_data_get_block_locked()\n\nWhen allocating clusters for a sparse or compressed attribute in\nattr_data_get_block_locked(), the requested virtual cluster number (vcn0)\nis aligned down to a frame boundary (vcn). The function then attempts to\nallocate a full frame of clusters.\n\nIf the disk is nearly full and highly fragmented, attr_allocate_clusters()\nmight only manage to allocate a small fragment and return success with a\npartial allocation length. If this partial allocation is so small that it\ndoes not even reach the originally requested vcn0 (i.e., end <= vcn0), vcn0\nremains unallocated (a sparse hole).\n\nWhen the code subsequently calls run_lookup_entry() for vcn0, it finds the\noriginal SPARSE_LCN entry, which triggers a WARN_ON(1).\n\nFix this by adding a check to verify if the partial allocation reached\nvcn0. If it did not (vcn0 >= end), treat this as an -ENOSPC failure and\njump to the undo1 label. This safely rolls back the partial allocation,\nrestores the original size, and repacks the runs, leaving the inode in a\nconsistent state before returning the error to the caller.\n\nWARNING: fs/ntfs3/attrib.c:1236 at attr_data_get_block_locked+0x1980/0x25d0\nfs/ntfs3/attrib.c:1236\nRIP: 0010:attr_data_get_block_locked+0x1980/0x25d0 fs/ntfs3/attrib.c:1236\nCall Trace:\n <TASK>\n attr_data_get_block+0x1f1/0x2a0 fs/ntfs3/attrib.c:979\n ntfs_fallocate+0xd3d/0xf70 fs/ntfs3/file.c:670\n vfs_fallocate+0x663/0x7f0 fs/open.c:338\n ksys_fallocate fs/open.c:362 [inline]\n __do_sys_fallocate fs/open.c:367 [inline]\n __se_sys_fallocate fs/open.c:365 [inline]\n __x64_sys_fallocate+0xbf/0x110 fs/open.c:365\n do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]\n do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94\n entry_SYSCALL_64_after_hwframe+0x77/0x7f\n </TASK>","publishedAt":"2026-11-30T13:32:09.369Z","updatedAt":"2026-11-30T13:32:09.369Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"099ef9ab9203dff327f2d61e44773f9acbc01f13","status":"affected","lessThan":"c16a49677579c5591e4355fae1a7240d32f269ec","versionType":"git"},{"version":"099ef9ab9203dff327f2d61e44773f9acbc01f13","status":"affected","lessThan":"ec67e8d61eb40a4e69b16d8931da217352447367","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ntfs3/attrib.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.0","status":"affected"},{"version":"0","status":"unaffected","lessThan":"7.0","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/ntfs3/attrib.c"]}],"references":["https://git.kernel.org/stable/c/c16a49677579c5591e4355fae1a7240d32f269ec","https://git.kernel.org/stable/c/ec67e8d61eb40a4e69b16d8931da217352447367"],"weaknesses":[],"ingestedAt":"2026-11-30T13:44:05.999Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139162.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139162","state":"PUBLISHED","datePublished":"2026-11-30T13:32:09.369Z","dateUpdated":"2026-11-30T13:32:09.369Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.917Z"},"containers":{"cna":{"title":"fs/ntfs3: handle partial allocation in attr_data_get_block_locked()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs/ntfs3: handle partial allocation in attr_data_get_block_locked()\n\nWhen allocating clusters for a sparse or compressed attribute in\nattr_data_get_block_locked(), the requested virtual cluster number (vcn0)\nis aligned down to a frame boundary (vcn). The function then attempts to\nallocate a full frame of clusters.\n\nIf the disk is nearly full and highly fragmented, attr_allocate_clusters()\nmight only manage to allocate a small fragment and return success with a\npartial allocation length. If this partial allocation is so small that it\ndoes not even reach the originally requested vcn0 (i.e., end <= vcn0), vcn0\nremains unallocated (a sparse hole).\n\nWhen the code subsequently calls run_lookup_entry() for vcn0, it finds the\noriginal SPARSE_LCN entry, which triggers a WARN_ON(1).\n\nFix this by adding a check to verify if the partial allocation reached\nvcn0. If it did not (vcn0 >= end), treat this as an -ENOSPC failure and\njump to the undo1 label. This safely rolls back the partial allocation,\nrestores the original size, and repacks the runs, leaving the inode in a\nconsistent state before returning the error to the caller.\n\nWARNING: fs/ntfs3/attrib.c:1236 at attr_data_get_block_locked+0x1980/0x25d0\nfs/ntfs3/attrib.c:1236\nRIP: 0010:attr_data_get_block_locked+0x1980/0x25d0 fs/ntfs3/attrib.c:1236\nCall Trace:\n <TASK>\n attr_data_get_block+0x1f1/0x2a0 fs/ntfs3/attrib.c:979\n ntfs_fallocate+0xd3d/0xf70 fs/ntfs3/file.c:670\n vfs_fallocate+0x663/0x7f0 fs/open.c:338\n ksys_fallocate fs/open.c:362 [inline]\n __do_sys_fallocate fs/open.c:367 [inline]\n __se_sys_fallocate fs/open.c:365 [inline]\n __x64_sys_fallocate+0xbf/0x110 fs/open.c:365\n do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]\n do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94\n entry_SYSCALL_64_after_hwframe+0x77/0x7f\n </TASK>"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"099ef9ab9203dff327f2d61e44773f9acbc01f13","status":"affected","lessThan":"c16a49677579c5591e4355fae1a7240d32f269ec","versionType":"git"},{"version":"099ef9ab9203dff327f2d61e44773f9acbc01f13","status":"affected","lessThan":"ec67e8d61eb40a4e69b16d8931da217352447367","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ntfs3/attrib.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.0","status":"affected"},{"version":"0","status":"unaffected","lessThan":"7.0","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/ntfs3/attrib.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/c16a49677579c5591e4355fae1a7240d32f269ec"},{"url":"https://git.kernel.org/stable/c/ec67e8d61eb40a4e69b16d8931da217352447367"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:32:09.369Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.0","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.0","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}