{"id":"CVE-2026-139333","state":"PUBLISHED","title":"btrfs: update the inode item when removing a free space inode","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: update the inode item when removing a free space inode\n\nbtrfs_remove_free_space_inode() adds an orphan item for the free space\ninode and clears its link count in memory, but never writes the inode\nitem. The item is only removed once the delayed iput evicts the inode,\nwhich happens in a later transaction, from the cleaner thread or a\nthrottled transaction end.\n\nIf we crash in between, or if evict can't reserve space for the\ntruncation and leaves the orphan item for the next mount, the on-disk\ninode still has a link count of 1. btrfs_orphan_cleanup() then treats it\nas an inode with links and only deletes the orphan item. The free space\nheader item is already gone at that point, so nothing ever finds the\ninode again, and its data extents are leaked.\n\nWrite the zero link count to the inode item in the same transaction as\nthe orphan item, so the orphan cleanup evicts the inode instead. Account\nfor the extra tree root item update when removing a block group.","publishedAt":"2026-11-30T13:33:47.556Z","updatedAt":"2026-11-30T13:33:47.556Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"455757c322cc0a0f2a692c5625dd88aaf6a7b889","status":"affected","lessThan":"36bc2d3b07f8e0818ad5be80bfcb869b5d34e112","versionType":"git"},{"version":"455757c322cc0a0f2a692c5625dd88aaf6a7b889","status":"affected","lessThan":"53e6ca355cbce4fedb0f2cdd70efb7944e844562","versionType":"git"},{"version":"455757c322cc0a0f2a692c5625dd88aaf6a7b889","status":"affected","lessThan":"b70c83b83cb651413f2215822c3e5def884d6b05","versionType":"git"},{"version":"455757c322cc0a0f2a692c5625dd88aaf6a7b889","status":"affected","lessThan":"4e89aff9ad6fcbec555c38169807c4023f93450f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/block-group.c","fs/btrfs/free-space-cache.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.2","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","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/btrfs/block-group.c","fs/btrfs/free-space-cache.c"]}],"references":["https://git.kernel.org/stable/c/36bc2d3b07f8e0818ad5be80bfcb869b5d34e112","https://git.kernel.org/stable/c/53e6ca355cbce4fedb0f2cdd70efb7944e844562","https://git.kernel.org/stable/c/b70c83b83cb651413f2215822c3e5def884d6b05","https://git.kernel.org/stable/c/4e89aff9ad6fcbec555c38169807c4023f93450f"],"weaknesses":[],"ingestedAt":"2026-11-30T13:48:04.491Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139333.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139333","state":"PUBLISHED","datePublished":"2026-11-30T13:33:47.556Z","dateUpdated":"2026-11-30T13:33:47.556Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.927Z"},"containers":{"cna":{"title":"btrfs: update the inode item when removing a free space inode","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: update the inode item when removing a free space inode\n\nbtrfs_remove_free_space_inode() adds an orphan item for the free space\ninode and clears its link count in memory, but never writes the inode\nitem. The item is only removed once the delayed iput evicts the inode,\nwhich happens in a later transaction, from the cleaner thread or a\nthrottled transaction end.\n\nIf we crash in between, or if evict can't reserve space for the\ntruncation and leaves the orphan item for the next mount, the on-disk\ninode still has a link count of 1. btrfs_orphan_cleanup() then treats it\nas an inode with links and only deletes the orphan item. The free space\nheader item is already gone at that point, so nothing ever finds the\ninode again, and its data extents are leaked.\n\nWrite the zero link count to the inode item in the same transaction as\nthe orphan item, so the orphan cleanup evicts the inode instead. Account\nfor the extra tree root item update when removing a block group."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"455757c322cc0a0f2a692c5625dd88aaf6a7b889","status":"affected","lessThan":"36bc2d3b07f8e0818ad5be80bfcb869b5d34e112","versionType":"git"},{"version":"455757c322cc0a0f2a692c5625dd88aaf6a7b889","status":"affected","lessThan":"53e6ca355cbce4fedb0f2cdd70efb7944e844562","versionType":"git"},{"version":"455757c322cc0a0f2a692c5625dd88aaf6a7b889","status":"affected","lessThan":"b70c83b83cb651413f2215822c3e5def884d6b05","versionType":"git"},{"version":"455757c322cc0a0f2a692c5625dd88aaf6a7b889","status":"affected","lessThan":"4e89aff9ad6fcbec555c38169807c4023f93450f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/block-group.c","fs/btrfs/free-space-cache.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.2","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","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/btrfs/block-group.c","fs/btrfs/free-space-cache.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/36bc2d3b07f8e0818ad5be80bfcb869b5d34e112"},{"url":"https://git.kernel.org/stable/c/53e6ca355cbce4fedb0f2cdd70efb7944e844562"},{"url":"https://git.kernel.org/stable/c/b70c83b83cb651413f2215822c3e5def884d6b05"},{"url":"https://git.kernel.org/stable/c/4e89aff9ad6fcbec555c38169807c4023f93450f"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:33:47.556Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.2","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.2","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.2","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.2","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}