CVE-2022-50126
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
18/06/2025
Last modified:
18/11/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
jbd2: fix assertion &#39;jh->b_frozen_data == NULL&#39; failure when journal aborted<br />
<br />
Following process will fail assertion &#39;jh->b_frozen_data == NULL&#39; in<br />
jbd2_journal_dirty_metadata():<br />
<br />
jbd2_journal_commit_transaction<br />
unlink(dir/a)<br />
jh->b_transaction = trans1<br />
jh->b_jlist = BJ_Metadata<br />
journal->j_running_transaction = NULL<br />
trans1->t_state = T_COMMIT<br />
unlink(dir/b)<br />
handle->h_trans = trans2<br />
do_get_write_access<br />
jh->b_modified = 0<br />
jh->b_frozen_data = frozen_buffer<br />
jh->b_next_transaction = trans2<br />
jbd2_journal_dirty_metadata<br />
is_handle_aborted<br />
is_journal_aborted // return false<br />
<br />
--> jbd2 abort t_buffers)<br />
if (is_journal_aborted)<br />
jbd2_journal_refile_buffer<br />
__jbd2_journal_refile_buffer<br />
WRITE_ONCE(jh->b_transaction,<br />
jh->b_next_transaction)<br />
WRITE_ONCE(jh->b_next_transaction, NULL)<br />
__jbd2_journal_file_buffer(jh, BJ_Reserved)<br />
J_ASSERT_JH(jh, jh->b_frozen_data == NULL) // assertion failure !<br />
<br />
The reproducer (See detail in [Link]) reports:<br />
------------[ cut here ]------------<br />
kernel BUG at fs/jbd2/transaction.c:1629!<br />
invalid opcode: 0000 [#1] PREEMPT SMP<br />
CPU: 2 PID: 584 Comm: unlink Tainted: G W<br />
5.19.0-rc6-00115-g4a57a8400075-dirty #697<br />
RIP: 0010:jbd2_journal_dirty_metadata+0x3c5/0x470<br />
RSP: 0018:ffffc90000be7ce0 EFLAGS: 00010202<br />
Call Trace:<br />
<br />
__ext4_handle_dirty_metadata+0xa0/0x290<br />
ext4_handle_dirty_dirblock+0x10c/0x1d0<br />
ext4_delete_entry+0x104/0x200<br />
__ext4_unlink+0x22b/0x360<br />
ext4_unlink+0x275/0x390<br />
vfs_unlink+0x20b/0x4c0<br />
do_unlinkat+0x42f/0x4c0<br />
__x64_sys_unlink+0x37/0x50<br />
do_syscall_64+0x35/0x80<br />
<br />
After journal aborting, __jbd2_journal_refile_buffer() is executed with<br />
holding @jh->b_state_lock, we can fix it by moving &#39;is_handle_aborted()&#39;<br />
into the area protected by @jh->b_state_lock.
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 2.6.20 (including) | 4.14.291 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.15 (including) | 4.19.256 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.20 (including) | 5.4.211 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.5 (including) | 5.10.137 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11 (including) | 5.15.61 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.16 (including) | 5.18.18 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.19 (including) | 5.19.2 (excluding) |
| cpe:2.3:o:linux:linux_kernel:2.6.19:-:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:2.6.19:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:2.6.19:rc3:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:2.6.19:rc4:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:2.6.19:rc5:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:2.6.19:rc6:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/0f61c6dc4b714be9d79cf0782ca02ba01c1b7ac3
- https://git.kernel.org/stable/c/4a734f0869f970b8a9b65062ea40b09a5da9dba8
- https://git.kernel.org/stable/c/6073389db83b903678a0920554fa19f5bdc51c48
- https://git.kernel.org/stable/c/731c1662d838fe954c6759e3ee43229b0d928fe4
- https://git.kernel.org/stable/c/ddd896792e1718cb84c96f3e618270589b6886dc
- https://git.kernel.org/stable/c/e62f79827784f56499a50ea2e893c98317b5407b
- https://git.kernel.org/stable/c/f7161d0da975adc234161cd0641d0e484f5ce375
- https://git.kernel.org/stable/c/fa5b65d39332fef7a11ae99cb1f0696012a61527



