В ядре Linux была устранена следующая уязвимость: ftrace: Fix потенциальное предупреждение в trace_printk_seq во время вызова ftrace_dump When ftrace_dump_one() одновременно с чтением trace_pipe, WARN_ON_ONCE() в trace_printk_seq() может быть вызвано из-за состояния гонки. Проблема возникает потому, что: CPU0 (ftrace_dump) CPU1 (читатель) echo z > /proc/sysrq-trigger !trace_empty(&iter) trace_iterator_reset(&iter) <- len size 0 cat /sys/kernel/tracing/trace_pipe trace_find_next_entry_inc(&iter) __find_next_entry ring_buffer_empty_cpu <- весь пустой возврат NULL trace_printk_seq(&iter.seq) WARN_ON_ONCE(s->seq.len s->seq.size) In контекст между trace_empty() и trace_find_next_entry_inc() во время ftrace_dump, данные кольцевого буфера потреблялись другими читателями. Это привело к тому, что trace_find_next_entry_inc вернул NULL, не сумев заполнить iter.seq.
В этот момент, из-за предыдущего trace_iterator_reset, оба iter.seq.len и iter.seq.size были установлены на 0. Поскольку они равны, запускается условие WARN_ON_ONCE. Переместите trace_printk_seq() в блок if, который проверяет, чтобы убедиться, что возвращаемое значение trace_find_next_entry_inc() не NULL в ftrace_dump_one(), гарантируя, что 'iter.seq' правильно заполнен перед последующими операциями.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: ftrace: Fix potential warning in trace_printk_seq during ftrace_dump When calling ftrace_dump_one() concurrently with reading trace_pipe, a WARN_ON_ONCE() in trace_printk_seq() can be triggered due to a race condition. The issue occurs because: CPU0 (ftrace_dump) CPU1 (reader) echo z > /proc/sysrq-trigger !trace_empty(&iter) trace_iterator_reset(&iter) <- len = size = 0 cat /sys/kernel/tracing/trace_pipe trace_find_next_entry_inc(&iter) __find_next_entry ring_buffer_empty_cpu <- all empty return NULL trace_printk_seq(&iter.seq) WARN_ON_ONCE(s->seq.len >= s->seq.size) In the context between trace_empty() and trace_find_next_entry_inc() during ftrace_dump, the ring buffer data was consumed by other readers. This caused trace_find_next_entry_inc to return NULL, failing to populate `iter.seq`. At this point, due to the prior trace_iterator_reset, both `iter.seq.len` and `iter.seq.size` were set to 0. Since they are equal, the WARN_ON_ONCE condition is triggered. Move the trace_printk_seq() into the if block that checks to make sure the return value of trace_find_next_entry_inc() is non-NULL in ftrace_dump_one(), ensuring the 'iter.seq' is properly populated before subsequent operations.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 10
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
2.6.28
|
5.4.298
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.5
|
5.10.242
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.11
|
5.15.191
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.16
|
6.1.150
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.2
|
6.6.104
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.7
|
6.12.45
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.16.5
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.17:rc1:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.17:rc2:*:*:*:*:*:*
|
— | — |
|
Debian Debian_Linux
cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*
|
— | — |