CVE-2025-71194

Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
04/02/2026
Last modified:
04/02/2026

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> btrfs: fix deadlock in wait_current_trans() due to ignored transaction type<br /> <br /> When wait_current_trans() is called during start_transaction(), it<br /> currently waits for a blocked transaction without considering whether<br /> the given transaction type actually needs to wait for that particular<br /> transaction state. The btrfs_blocked_trans_types[] array already defines<br /> which transaction types should wait for which transaction states, but<br /> this check was missing in wait_current_trans().<br /> <br /> This can lead to a deadlock scenario involving two transactions and<br /> pending ordered extents:<br /> <br /> 1. Transaction A is in TRANS_STATE_COMMIT_DOING state<br /> <br /> 2. A worker processing an ordered extent calls start_transaction()<br /> with TRANS_JOIN<br /> <br /> 3. join_transaction() returns -EBUSY because Transaction A is in<br /> TRANS_STATE_COMMIT_DOING<br /> <br /> 4. Transaction A moves to TRANS_STATE_UNBLOCKED and completes<br /> <br /> 5. A new Transaction B is created (TRANS_STATE_RUNNING)<br /> <br /> 6. The ordered extent from step 2 is added to Transaction B&amp;#39;s<br /> pending ordered extents<br /> <br /> 7. Transaction B immediately starts commit by another task and<br /> enters TRANS_STATE_COMMIT_START<br /> <br /> 8. The worker finally reaches wait_current_trans(), sees Transaction B<br /> in TRANS_STATE_COMMIT_START (a blocked state), and waits<br /> unconditionally<br /> <br /> 9. However, TRANS_JOIN should NOT wait for TRANS_STATE_COMMIT_START<br /> according to btrfs_blocked_trans_types[]<br /> <br /> 10. Transaction B is waiting for pending ordered extents to complete<br /> <br /> 11. Deadlock: Transaction B waits for ordered extent, ordered extent<br /> waits for Transaction B<br /> <br /> This can be illustrated by the following call stacks:<br /> CPU0 CPU1<br /> btrfs_finish_ordered_io()<br /> start_transaction(TRANS_JOIN)<br /> join_transaction()<br /> # -EBUSY (Transaction A is<br /> # TRANS_STATE_COMMIT_DOING)<br /> # Transaction A completes<br /> # Transaction B created<br /> # ordered extent added to<br /> # Transaction B&amp;#39;s pending list<br /> btrfs_commit_transaction()<br /> # Transaction B enters<br /> # TRANS_STATE_COMMIT_START<br /> # waiting for pending ordered<br /> # extents<br /> wait_current_trans()<br /> # waits for Transaction B<br /> # (should not wait!)<br /> <br /> Task bstore_kv_sync in btrfs_commit_transaction waiting for ordered<br /> extents:<br /> <br /> __schedule+0x2e7/0x8a0<br /> schedule+0x64/0xe0<br /> btrfs_commit_transaction+0xbf7/0xda0 [btrfs]<br /> btrfs_sync_file+0x342/0x4d0 [btrfs]<br /> __x64_sys_fdatasync+0x4b/0x80<br /> do_syscall_64+0x33/0x40<br /> entry_SYSCALL_64_after_hwframe+0x44/0xa9<br /> <br /> Task kworker in wait_current_trans waiting for transaction commit:<br /> <br /> Workqueue: btrfs-syno_nocow btrfs_work_helper [btrfs]<br /> __schedule+0x2e7/0x8a0<br /> schedule+0x64/0xe0<br /> wait_current_trans+0xb0/0x110 [btrfs]<br /> start_transaction+0x346/0x5b0 [btrfs]<br /> btrfs_finish_ordered_io.isra.0+0x49b/0x9c0 [btrfs]<br /> btrfs_work_helper+0xe8/0x350 [btrfs]<br /> process_one_work+0x1d3/0x3c0<br /> worker_thread+0x4d/0x3e0<br /> kthread+0x12d/0x150<br /> ret_from_fork+0x1f/0x30<br /> <br /> Fix this by passing the transaction type to wait_current_trans() and<br /> checking btrfs_blocked_trans_types[cur_trans-&gt;state] against the given<br /> type before deciding to wait. This ensures that transaction types which<br /> are allowed to join during certain blocked states will not unnecessarily<br /> wait and cause deadlocks.

Impact