{"id":"CVE-2026-139216","state":"PUBLISHED","title":"ntfs: fix u16 truncation of the update sequence array count check","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nntfs: fix u16 truncation of the update sequence array count check\n\nntfs_check_restart_page_header() bounds the on-disk system page size by\nrecomputing the update sequence array count from it:\n\n\tu16 ra_ofs, usa_count, usa_ofs, usa_end = 0;\n\t...\n\tusa_count = 1 + (logfile_system_page_size >> NTFS_BLOCK_SIZE_BITS);\n\tif (usa_count != le16_to_cpu(rp->usa_count))\n\t\treturn false;\n\nThe right hand side is computed in u32 but stored in a u16, so the count\nwraps once the system page size reaches 0x2000000.  An image claiming any\nlarger power of two passes the check by also claiming usa_count == 1.\n\nNothing else limits the value, so ntfs_check_and_load_restart_page() goes\non to kvzalloc() up to 2 GiB for the restart page and copy that many bytes\na page at a time.  The size is only rejected afterwards, by the\n(size >> NTFS_BLOCK_SIZE_BITS) != usa_count test in post_read_mst_fixup().\n\nCompute the count in a u32 so the existing check rejects an over-large\nsystem page size instead of being defeated by the truncation.  This adds\nno new limit: the array holds one u16 per protected sector plus the update\nsequence number and must end within the first sector, which caps usa_count\nat 240 and the system page size at 64 KiB.\n\nWiden ra_ofs and usa_ofs as well, as ntfs_check_restart_area() already\ndoes: both are loaded from __le16 on-disk fields and every comparison is\nagainst a non-negative value, so no result changes.","publishedAt":"2026-11-30T13:32:39.766Z","updatedAt":"2026-11-30T13:32:39.766Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1e9ea7e04472d4e5e12e58c881eaacfb3e49b669","status":"affected","lessThan":"0e833b45127032953e2ea6b3659e827dc67e064a","versionType":"git"},{"version":"1e9ea7e04472d4e5e12e58c881eaacfb3e49b669","status":"affected","lessThan":"b713b69cf79ef52b1737a1a6c09df2522ff875af","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ntfs/logfile.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/logfile.c"]}],"references":["https://git.kernel.org/stable/c/0e833b45127032953e2ea6b3659e827dc67e064a","https://git.kernel.org/stable/c/b713b69cf79ef52b1737a1a6c09df2522ff875af"],"weaknesses":[],"ingestedAt":"2026-11-30T13:44:05.999Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139216.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139216","state":"PUBLISHED","datePublished":"2026-11-30T13:32:39.766Z","dateUpdated":"2026-11-30T13:32:39.766Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.921Z"},"containers":{"cna":{"title":"ntfs: fix u16 truncation of the update sequence array count check","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nntfs: fix u16 truncation of the update sequence array count check\n\nntfs_check_restart_page_header() bounds the on-disk system page size by\nrecomputing the update sequence array count from it:\n\n\tu16 ra_ofs, usa_count, usa_ofs, usa_end = 0;\n\t...\n\tusa_count = 1 + (logfile_system_page_size >> NTFS_BLOCK_SIZE_BITS);\n\tif (usa_count != le16_to_cpu(rp->usa_count))\n\t\treturn false;\n\nThe right hand side is computed in u32 but stored in a u16, so the count\nwraps once the system page size reaches 0x2000000.  An image claiming any\nlarger power of two passes the check by also claiming usa_count == 1.\n\nNothing else limits the value, so ntfs_check_and_load_restart_page() goes\non to kvzalloc() up to 2 GiB for the restart page and copy that many bytes\na page at a time.  The size is only rejected afterwards, by the\n(size >> NTFS_BLOCK_SIZE_BITS) != usa_count test in post_read_mst_fixup().\n\nCompute the count in a u32 so the existing check rejects an over-large\nsystem page size instead of being defeated by the truncation.  This adds\nno new limit: the array holds one u16 per protected sector plus the update\nsequence number and must end within the first sector, which caps usa_count\nat 240 and the system page size at 64 KiB.\n\nWiden ra_ofs and usa_ofs as well, as ntfs_check_restart_area() already\ndoes: both are loaded from __le16 on-disk fields and every comparison is\nagainst a non-negative value, so no result changes."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1e9ea7e04472d4e5e12e58c881eaacfb3e49b669","status":"affected","lessThan":"0e833b45127032953e2ea6b3659e827dc67e064a","versionType":"git"},{"version":"1e9ea7e04472d4e5e12e58c881eaacfb3e49b669","status":"affected","lessThan":"b713b69cf79ef52b1737a1a6c09df2522ff875af","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ntfs/logfile.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/logfile.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/0e833b45127032953e2ea6b3659e827dc67e064a"},{"url":"https://git.kernel.org/stable/c/b713b69cf79ef52b1737a1a6c09df2522ff875af"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:32:39.766Z"},"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"}}}}}