В ядре Linux устранена следующая уязвимость:
jbd2: проверьте jh->b_transaction перед удалением его из контрольной точки
Следующий процесс приведет к повреждению образа ext4:
Шаг 1:
jbd2_journal_commit_transaction
__jbd2_journal_insert_checkpoint(jh, commit_transaction)
// Помещаем jh в trans1->t_checkpoint_list
журнал->j_checkpoint_transactions = commit_transaction
// Помещаем trans1 в журнал->j_checkpoint_transactions
Шаг 2:
do_get_write_access
test_clear_buffer_dirty(bh) // очистка буфера от загрязнений, установка jbd в загрязненный режим
__jbd2_journal_file_buffer(jh, транзакции) // jh принадлежит trans2
Шаг 3:
drop_cache
журнал_shrink_one_cp_list
jbd2_journal_try_remove_checkpoint
if (!trylock_buffer(bh)) // блокируем bh, true
if (buffer_dirty(bh)) // буфер не загрязнен
__jbd2_journal_remove_checkpoint(jh)
// удаляем jh из trans1->t_checkpoint_list
Шаг 4:
jbd2_log_do_checkpoint
trans1 = журнал->j_checkpoint_transactions
// jh нет в trans1->t_checkpoint_list
jbd2_cleanup_journal_tail(journal) // trans1 завершен
Шаг 5: Отключение питания, trans2 не зафиксирован, jh теряется при следующем монтаже.
Исправьте это, проверив jh->b_transaction перед удалением его из контрольной точки.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: jbd2: check 'jh->b_transaction' before removing it from checkpoint Following process will corrupt ext4 image: Step 1: jbd2_journal_commit_transaction __jbd2_journal_insert_checkpoint(jh, commit_transaction) // Put jh into trans1->t_checkpoint_list journal->j_checkpoint_transactions = commit_transaction // Put trans1 into journal->j_checkpoint_transactions Step 2: do_get_write_access test_clear_buffer_dirty(bh) // clear buffer dirty,set jbd dirty __jbd2_journal_file_buffer(jh, transaction) // jh belongs to trans2 Step 3: drop_cache journal_shrink_one_cp_list jbd2_journal_try_remove_checkpoint if (!trylock_buffer(bh)) // lock bh, true if (buffer_dirty(bh)) // buffer is not dirty __jbd2_journal_remove_checkpoint(jh) // remove jh from trans1->t_checkpoint_list Step 4: jbd2_log_do_checkpoint trans1 = journal->j_checkpoint_transactions // jh is not in trans1->t_checkpoint_list jbd2_cleanup_journal_tail(journal) // trans1 is done Step 5: Power cut, trans2 is not committed, jh is lost in next mounting. Fix it by checking 'jh->b_transaction' before remove it from checkpoint.
Характеристики атаки
Последствия
Строка CVSS v3.1
Уязвимые продукты 10
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.15.129
|
5.15.132
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.1.50
|
6.1.54
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.4.13
|
6.5
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.5.1
|
6.5.4
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.5:-:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.5:rc3:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.5:rc4:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.5:rc5:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.5:rc6:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.5:rc7:*:*:*:*:*:*
|
— | — |