{"id":"CVE-2026-139234","aliases":["CVE-2026-139234"],"related":[],"kind":"vulnerability","state":"published","title":"exfat: fix used_clusters accounting during cluster allocation","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nexfat: fix used_clusters accounting during cluster allocation\n\nIn the current exfat_alloc_cluster(), p_chain->size is incremented as\neach cluster is allocated so that the partially allocated chain can\nbe freed by __exfat_free_cluster() on the error path.\n\nHowever, sbi->used_clusters is still updated only after all clusters\nhave been allocated, while __exfat_free_cluster() unconditionally\nsubtracts the number of freed clusters from sbi->used_clusters.\nTherefore, when allocation fails partway through, the partially\nallocated clusters are subtracted from sbi->used_clusters even\nthough they were never added to it. This corrupts the free-space\naccounting and can cause sbi->used_clusters to underflow.\n\nIncrement sbi->used_clusters together with p_chain->size as each\ncluster is allocated. This keeps the accounting consistent with\n__exfat_free_cluster() on both the success and error paths.\n\nThis issue is caught by generic/476 with 256k cluster size:\n\n    Ran: generic/476\n    Failures: generic/476\n    Failed 1 of 1 tests\n\n    *** fsck.exfat output ***\n    ERROR: <path>: more clusters are allocated. truncate to N bytes\n    ...\n    /dev/vdc: corrupted. directories 331, files 526\n    /dev/vdc: files corrupted 9, files fixed 0\n    *** end fsck.exfat output ***","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nexfat: fix used_clusters accounting during cluster allocation\n\nIn the current exfat_alloc_cluster(), p_chain->size is incremented as\neach cluster is allocated so that the partially allocated chain can\nbe freed by __exfat_free_cluster() on the error path.\n\nHowever, sbi->used_clusters is still updated only after all clusters\nhave been allocated, while __exfat_free_cluster() unconditionally\nsubtracts the number of freed clusters from sbi->used_clusters.\nTherefore, when allocation fails partway through, the partially\nallocated clusters are subtracted from sbi->used_clusters even\nthough they were never added to it. This corrupts the free-space\naccounting and can cause sbi->used_clusters to underflow.\n\nIncrement sbi->used_clusters together with p_chain->size as each\ncluster is allocated. This keeps the accounting consistent with\n__exfat_free_cluster() on both the success and error paths.\n\nThis issue is caught by generic/476 with 256k cluster size:\n\n    Ran: generic/476\n    Failures: generic/476\n    Failed 1 of 1 tests\n\n    *** fsck.exfat output ***\n    ERROR: <path>: more clusters are allocated. truncate to N bytes\n    ...\n    /dev/vdc: corrupted. directories 331, files 526\n    /dev/vdc: files corrupted 9, files fixed 0\n    *** end fsck.exfat output ***","source":"cvelist"}],"published":"2026-11-30T13:32:51.780Z","modified":"2026-11-30T14:18:45.373Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"d5c514b6a0c0b77ed7e5ef2484e8b20eb09c5f27","fixed":"b0825472aeb9deb458296071c81d6396b0d20677","status":"affected"},{"type":"git","introduced":"d5c514b6a0c0b77ed7e5ef2484e8b20eb09c5f27","fixed":"8dd879d08328fdf47a29700b89015a8dca53aefd","status":"affected"},{"type":"git","introduced":"d5c514b6a0c0b77ed7e5ef2484e8b20eb09c5f27","fixed":"fabe14fd8555ae8bc5933df390e548d77e7336fd","status":"affected"},{"type":"git","introduced":"d5c514b6a0c0b77ed7e5ef2484e8b20eb09c5f27","fixed":"cb9dbf8a4e34b4fdf311598835ab4d76ed7e07c1","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.3","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.3","status":"unaffected"},{"type":"semver","introduced":"6.12.120","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.66","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.6","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/b0825472aeb9deb458296071c81d6396b0d20677","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/8dd879d08328fdf47a29700b89015a8dca53aefd","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/fabe14fd8555ae8bc5933df390e548d77e7336fd","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/cb9dbf8a4e34b4fdf311598835ab4d76ed7e07c1","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-139234","url":"https://www.cve.org/CVERecord?id=CVE-2026-139234","licence":"CVE Terms of Use","modified":"2026-11-30T13:32:51.780Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-139234","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139234","licence":"Public domain","modified":"2026-11-30T14:18:45.373Z"}],"updatedAt":"2026-11-30T14:33:13.993Z","epss":{"score":0.00201,"percentile":0.10484,"date":"2026-12-01T12:00:22.000Z"}}