{"id":"CVE-2026-143241","state":"PUBLISHED","title":"btrfs: zoned: don't wait for ordered extents in do_zone_finish()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: zoned: don't wait for ordered extents in do_zone_finish()\n\ndo_zone_finish() calls btrfs_wait_ordered_roots(), which holds\nfs_info->ordered_operations_mutex while waiting for writeback. It can be\nreached from writeback itself:\n\n  cow_file_range()\n  `-> btrfs_reserve_extent()\n    `-> find_free_extent()\n      `-> btrfs_zone_finish_one_bg()\n        `-> do_zone_finish()\n\nIf another task holds the mutex and waits for that writeback, this\ndeadlocks.\n\nIn general, we want to ensure all writes in the block group to\ncomplete before finishing the zone, as relocation does. However, the\ncurrent callers do not need the wait (or cannot wait) in do_zone_finish():\n\n- Relocation already waits for reservations and ordered extents itself\n  before calling btrfs_zone_finish().\n- btrfs_delete_unused_bgs() checks that ->reserved is zero and sets the\n  block group read-only while holding groups_sem, so there can be no\n  in-flight data write.\n- btrfs_zone_finish_one_bg() is called from the allocation path and\n  cannot wait.\n\nDropping the wait is still safe. Once the block group is read-only,\n->reserved can only drop, and for data it only drops after the ordered\nextent's I/O has completed. So if ->reserved is zero, no data write is\nleft in flight. If it is non-zero, do_zone_finish() returns -EAGAIN,\nwhich all callers handle.\n\nThis makes btrfs_zone_finish_one_bg() fail with -EAGAIN when it races\nwith an allocation in the selected block group.","publishedAt":"2026-12-03T09:20:53.703Z","updatedAt":"2026-12-03T09:20:53.703Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"393f646e34c18b85d0f41272bfcbd475ae3a0d34","status":"affected","lessThan":"d87f8bd1c92559fbd945ba7a202d0013c6436372","versionType":"git"},{"version":"393f646e34c18b85d0f41272bfcbd475ae3a0d34","status":"affected","lessThan":"b9d98dbc30312db7eeb77f4ed46af9573f17bc93","versionType":"git"},{"version":"393f646e34c18b85d0f41272bfcbd475ae3a0d34","status":"affected","lessThan":"bd1e6c8aacf49c9198ebe0664cc292052e597a43","versionType":"git"},{"version":"393f646e34c18b85d0f41272bfcbd475ae3a0d34","status":"affected","lessThan":"bcad7df05237382237ad1517411721d839174009","versionType":"git"},{"version":"8be240190e01934b2f2009a73b2967cc7f0c6344","status":"affected","versionType":"git"},{"version":"f6ad412c647ac32e3ed2750b99c87c119daea9bb","status":"affected","versionType":"git"},{"version":"5.18.18","status":"affected","lessThan":"5.19","versionType":"semver"},{"version":"5.19.2","status":"affected","lessThan":"5.20","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/zoned.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.0","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.0","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/zoned.c"]}],"references":["https://git.kernel.org/stable/c/d87f8bd1c92559fbd945ba7a202d0013c6436372","https://git.kernel.org/stable/c/b9d98dbc30312db7eeb77f4ed46af9573f17bc93","https://git.kernel.org/stable/c/bd1e6c8aacf49c9198ebe0664cc292052e597a43","https://git.kernel.org/stable/c/bcad7df05237382237ad1517411721d839174009"],"weaknesses":[],"ingestedAt":"2026-12-03T09:42:04.348Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143241.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143241","state":"PUBLISHED","datePublished":"2026-12-03T09:20:53.703Z","dateUpdated":"2026-12-03T09:20:53.703Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.362Z"},"containers":{"cna":{"title":"btrfs: zoned: don't wait for ordered extents in do_zone_finish()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: zoned: don't wait for ordered extents in do_zone_finish()\n\ndo_zone_finish() calls btrfs_wait_ordered_roots(), which holds\nfs_info->ordered_operations_mutex while waiting for writeback. It can be\nreached from writeback itself:\n\n  cow_file_range()\n  `-> btrfs_reserve_extent()\n    `-> find_free_extent()\n      `-> btrfs_zone_finish_one_bg()\n        `-> do_zone_finish()\n\nIf another task holds the mutex and waits for that writeback, this\ndeadlocks.\n\nIn general, we want to ensure all writes in the block group to\ncomplete before finishing the zone, as relocation does. However, the\ncurrent callers do not need the wait (or cannot wait) in do_zone_finish():\n\n- Relocation already waits for reservations and ordered extents itself\n  before calling btrfs_zone_finish().\n- btrfs_delete_unused_bgs() checks that ->reserved is zero and sets the\n  block group read-only while holding groups_sem, so there can be no\n  in-flight data write.\n- btrfs_zone_finish_one_bg() is called from the allocation path and\n  cannot wait.\n\nDropping the wait is still safe. Once the block group is read-only,\n->reserved can only drop, and for data it only drops after the ordered\nextent's I/O has completed. So if ->reserved is zero, no data write is\nleft in flight. If it is non-zero, do_zone_finish() returns -EAGAIN,\nwhich all callers handle.\n\nThis makes btrfs_zone_finish_one_bg() fail with -EAGAIN when it races\nwith an allocation in the selected block group."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"393f646e34c18b85d0f41272bfcbd475ae3a0d34","status":"affected","lessThan":"d87f8bd1c92559fbd945ba7a202d0013c6436372","versionType":"git"},{"version":"393f646e34c18b85d0f41272bfcbd475ae3a0d34","status":"affected","lessThan":"b9d98dbc30312db7eeb77f4ed46af9573f17bc93","versionType":"git"},{"version":"393f646e34c18b85d0f41272bfcbd475ae3a0d34","status":"affected","lessThan":"bd1e6c8aacf49c9198ebe0664cc292052e597a43","versionType":"git"},{"version":"393f646e34c18b85d0f41272bfcbd475ae3a0d34","status":"affected","lessThan":"bcad7df05237382237ad1517411721d839174009","versionType":"git"},{"version":"8be240190e01934b2f2009a73b2967cc7f0c6344","status":"affected","versionType":"git"},{"version":"f6ad412c647ac32e3ed2750b99c87c119daea9bb","status":"affected","versionType":"git"},{"version":"5.18.18","status":"affected","lessThan":"5.19","versionType":"semver"},{"version":"5.19.2","status":"affected","lessThan":"5.20","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/zoned.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.0","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.0","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/zoned.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/d87f8bd1c92559fbd945ba7a202d0013c6436372"},{"url":"https://git.kernel.org/stable/c/b9d98dbc30312db7eeb77f4ed46af9573f17bc93"},{"url":"https://git.kernel.org/stable/c/bd1e6c8aacf49c9198ebe0664cc292052e597a43"},{"url":"https://git.kernel.org/stable/c/bcad7df05237382237ad1517411721d839174009"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:20:53.703Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.0","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.0","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.0","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.0","versionEndExcluding":"7.4-rc3"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18.18"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19.2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}