btrfs: fix deadlock in wait_current_trans() due to ignored transaction type
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 4a9d8bdee368de78ace8b36da4eb2186afea162d · < 9ac63333d600732a56b35ee1fa46836da671eb50| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix deadlock in wait_current_trans() due to ignored transaction type
When wait_current_trans() is called during start_transaction(), it currently waits for a blocked transaction without considering whether the given transaction type actually needs to wait for that particular transaction state. The btrfs_blocked_trans_types[] array already defines which transaction types should wait for which transaction states, but this check was missing in wait_current_trans().
This can lead to a deadlock scenario involving two transactions and pending ordered extents:
1. Transaction A is in TRANS_STATE_COMMIT_DOING state
2. A worker processing an ordered extent calls start_transaction() with TRANS_JOIN
3. join_transaction() returns -EBUSY because Transaction A is in TRANS_STATE_COMMIT_DOING
4. Transaction A moves to TRANS_STATE_UNBLOCKED and completes
From the CVE record · Linux
The Linux kernel’s btrfs wait_current_trans() can wait for a transaction state that does not require waiting. During concurrent transaction commits and ordered-extent processing, this can deadlock the commit and its worker. The input does not specify an attacker, authentication requirement, or user interaction.
Engineers running Linux with btrfs should check their kernels; affected versions are not specified.