{"api_version":"1","generated_at":"2026-12-02T09:12:54+00:00","cve":"CVE-2026-99967","urls":{"html":"https://cve.report/CVE-2026-99967","api":"https://cve.report/api/cve/CVE-2026-99967.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-99967","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-99967"},"summary":{"title":"exfat: free clusters beyond EOF when a write fails or is short","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nexfat: free clusters beyond EOF when a write fails or is short\n\nCommit 82a81a7352bc (\"exfat: add iomap buffered I/O support\") and commit\n867b9c96dc83 (\"exfat: add iomap direct I/O support\") made a write\nallocate the clusters for its whole range in one step. They also dropped\nexfat_write_failed(), which freed the clusters beyond the end of the\nfile after a failed or short write.\n\nHowever, a write can stop early, for example when the process is killed\nor when a part of the buffer cannot be read. As of now, the clusters for\nthe part that was not written stay allocated beyond the end of the file.\nexfat_cont_expand() does not expect them, so a later write or truncate\nthat extends the file fails with ENOSPC. The directory entry records\nonly the size of the file, so the space can be lost for good once the\nvolume is unmounted.\n\nThe issue can be reproduced on a 64M volume made by mkfs.exfat and\nmounted on /mnt, with a write of 1M from a buffer that has only its\nfirst 4K mapped:\n\n    #include <fcntl.h>\n    #include <stdio.h>\n    #include <sys/mman.h>\n    #include <sys/stat.h>\n    #include <unistd.h>\n\n    int main(void)\n    {\n            char *p = mmap(NULL, 8192, PROT_READ | PROT_WRITE,\n                           MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);\n            int fd = open(\"/mnt/f\", O_CREAT | O_WRONLY, 0644);\n            struct stat st;\n\n            munmap(p + 4096, 4096);\n            printf(\"write: %zd\\n\", write(fd, p, 1 << 20));\n            fstat(fd, &st);\n            printf(\"blocks: %ld\\n\", (long)st.st_blocks);\n            printf(\"ftruncate: %d\\n\", ftruncate(fd, 1 << 16));\n            return 0;\n    }\n\nBefore commit 82a81a7352bc (\"exfat: add iomap buffered I/O support\"),\nthe result is:\n\n    write: 4096\n    blocks: 8\n    ftruncate: 0\n\nAfter that commit, the result is:\n\n    write: 4096\n    blocks: 2048\n    ftruncate: -1\n\nThis patch will bring back exfat_write_failed() and call it when a write\nends before the end of its range, so that the clusters beyond the end of\nthe file are freed again. It waits for direct I/O in flight first, as\nexfat_setattr() does before it frees clusters.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-30 14:20:36","updated_at":"2026-11-30 14:20:36"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/ea6fbcebee22a96387314341f4b9386873d91e39","name":"https://git.kernel.org/stable/c/ea6fbcebee22a96387314341f4b9386873d91e39","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/b4c282c0d82e8715ea9ed0b35813a3f365e3f952","name":"https://git.kernel.org/stable/c/b4c282c0d82e8715ea9ed0b35813a3f365e3f952","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-99967","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99967","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 82a81a7352bcf5f2756ac33d47ee0582737e9a85 ea6fbcebee22a96387314341f4b9386873d91e39 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 82a81a7352bcf5f2756ac33d47ee0582737e9a85 b4c282c0d82e8715ea9ed0b35813a3f365e3f952 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 7.2","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.2 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.4 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["fs/exfat/file.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"ea6fbcebee22a96387314341f4b9386873d91e39","status":"affected","version":"82a81a7352bcf5f2756ac33d47ee0582737e9a85","versionType":"git"},{"lessThan":"b4c282c0d82e8715ea9ed0b35813a3f365e3f952","status":"affected","version":"82a81a7352bcf5f2756ac33d47ee0582737e9a85","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["fs/exfat/file.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"7.2"},{"lessThan":"7.2","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.4","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.4","versionStartIncluding":"7.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"7.2","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nexfat: free clusters beyond EOF when a write fails or is short\n\nCommit 82a81a7352bc (\"exfat: add iomap buffered I/O support\") and commit\n867b9c96dc83 (\"exfat: add iomap direct I/O support\") made a write\nallocate the clusters for its whole range in one step. They also dropped\nexfat_write_failed(), which freed the clusters beyond the end of the\nfile after a failed or short write.\n\nHowever, a write can stop early, for example when the process is killed\nor when a part of the buffer cannot be read. As of now, the clusters for\nthe part that was not written stay allocated beyond the end of the file.\nexfat_cont_expand() does not expect them, so a later write or truncate\nthat extends the file fails with ENOSPC. The directory entry records\nonly the size of the file, so the space can be lost for good once the\nvolume is unmounted.\n\nThe issue can be reproduced on a 64M volume made by mkfs.exfat and\nmounted on /mnt, with a write of 1M from a buffer that has only its\nfirst 4K mapped:\n\n    #include <fcntl.h>\n    #include <stdio.h>\n    #include <sys/mman.h>\n    #include <sys/stat.h>\n    #include <unistd.h>\n\n    int main(void)\n    {\n            char *p = mmap(NULL, 8192, PROT_READ | PROT_WRITE,\n                           MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);\n            int fd = open(\"/mnt/f\", O_CREAT | O_WRONLY, 0644);\n            struct stat st;\n\n            munmap(p + 4096, 4096);\n            printf(\"write: %zd\\n\", write(fd, p, 1 << 20));\n            fstat(fd, &st);\n            printf(\"blocks: %ld\\n\", (long)st.st_blocks);\n            printf(\"ftruncate: %d\\n\", ftruncate(fd, 1 << 16));\n            return 0;\n    }\n\nBefore commit 82a81a7352bc (\"exfat: add iomap buffered I/O support\"),\nthe result is:\n\n    write: 4096\n    blocks: 8\n    ftruncate: 0\n\nAfter that commit, the result is:\n\n    write: 4096\n    blocks: 2048\n    ftruncate: -1\n\nThis patch will bring back exfat_write_failed() and call it when a write\nends before the end of its range, so that the clusters beyond the end of\nthe file are freed again. It waits for direct I/O in flight first, as\nexfat_setattr() does before it frees clusters."}],"providerMetadata":{"dateUpdated":"2026-11-30T13:18:43.513Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/ea6fbcebee22a96387314341f4b9386873d91e39"},{"url":"https://git.kernel.org/stable/c/b4c282c0d82e8715ea9ed0b35813a3f365e3f952"}],"title":"exfat: free clusters beyond EOF when a write fails or is short","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-99967","datePublished":"2026-11-30T13:18:43.513Z","dateReserved":"2026-09-25T10:25:14.449Z","dateUpdated":"2026-11-30T13:18:43.513Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 14:20:36","lastModifiedDate":"2026-11-30 14:20:36","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"99967","Ordinal":"1","Title":"exfat: free clusters beyond EOF when a write fails or is short","CVE":"CVE-2026-99967","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"99967","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nexfat: free clusters beyond EOF when a write fails or is short\n\nCommit 82a81a7352bc (\"exfat: add iomap buffered I/O support\") and commit\n867b9c96dc83 (\"exfat: add iomap direct I/O support\") made a write\nallocate the clusters for its whole range in one step. They also dropped\nexfat_write_failed(), which freed the clusters beyond the end of the\nfile after a failed or short write.\n\nHowever, a write can stop early, for example when the process is killed\nor when a part of the buffer cannot be read. As of now, the clusters for\nthe part that was not written stay allocated beyond the end of the file.\nexfat_cont_expand() does not expect them, so a later write or truncate\nthat extends the file fails with ENOSPC. The directory entry records\nonly the size of the file, so the space can be lost for good once the\nvolume is unmounted.\n\nThe issue can be reproduced on a 64M volume made by mkfs.exfat and\nmounted on /mnt, with a write of 1M from a buffer that has only its\nfirst 4K mapped:\n\n    #include <fcntl.h>\n    #include <stdio.h>\n    #include <sys/mman.h>\n    #include <sys/stat.h>\n    #include <unistd.h>\n\n    int main(void)\n    {\n            char *p = mmap(NULL, 8192, PROT_READ | PROT_WRITE,\n                           MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);\n            int fd = open(\"/mnt/f\", O_CREAT | O_WRONLY, 0644);\n            struct stat st;\n\n            munmap(p + 4096, 4096);\n            printf(\"write: %zd\\n\", write(fd, p, 1 << 20));\n            fstat(fd, &st);\n            printf(\"blocks: %ld\\n\", (long)st.st_blocks);\n            printf(\"ftruncate: %d\\n\", ftruncate(fd, 1 << 16));\n            return 0;\n    }\n\nBefore commit 82a81a7352bc (\"exfat: add iomap buffered I/O support\"),\nthe result is:\n\n    write: 4096\n    blocks: 8\n    ftruncate: 0\n\nAfter that commit, the result is:\n\n    write: 4096\n    blocks: 2048\n    ftruncate: -1\n\nThis patch will bring back exfat_write_failed() and call it when a write\nends before the end of its range, so that the clusters beyond the end of\nthe file are freed again. It waits for direct I/O in flight first, as\nexfat_setattr() does before it frees clusters.","Type":"Description","Title":"exfat: free clusters beyond EOF when a write fails or is short"}]}}}