btrfs: take commit root semaphore when iterating in mark_block_group_to_copy()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 78ce9fc269af6e69c1399ab910ba6bc81c934f67 · < c32490c6d3f3a9f2d177d57c7eb8bbc347561d08| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
btrfs: take commit root semaphore when iterating in mark_block_group_to_copy()
mark_block_group_to_copy() iterates over the commit root with skip_locking=true. A concurrent transaction commit can swap and free the commit root during iteration, causing use-after-free when accessing extent buffers.
Fix it by using path->need_commit_sem to protect the commit root search.
From the CVE record · Linux
In the Linux kernel, btrfs can access freed extent buffers while mark_block_group_to_copy() iterates over the commit root. This can happen if a concurrent transaction commit swaps and frees that root; the input does not specify an attack path or authentication requirements.
Engineers running Linux kernels with btrfs should check whether their versions include the fix.