В ядре Linux устранена следующая уязвимость:
sched/rt: пропустить текущий процессор в rto_next_cpu(). CPU0 перегружается при размещении задачи RT с привязкой к ЦП. Задача RT и задача CFS, застрявшая в пространстве ядра.
Когда другие процессоры переключаются с
RT к задачам, не относящимся к RT, запускается балансировка нагрузки RT (LB); с
HAVE_RT_PUSH_IPI включен, они отправляют IPI на CPU0 для управления выполнением.
из rto_push_irq_work_func. Во время push_rt_task на CPU0
если next_task->prio < rq->donor->prio, resched_curr() устанавливает NEED_RESCHED
и после завершения операции push CPU0 вызывает rto_next_cpu(). Поскольку в этом сценарии перегружен только CPU0, rto_next_cpu() должен
в идеале верните -1 (дополнительный IPI не требуется).
Однако несколько процессоров вызывают функцию Tell_cpu_to_push() во время приращения LB.
rd->rto_loop_next. Даже если для rd->rto_cpu установлено значение -1, несоответствие между
rd->rto_loop и rd->rto_loop_next заставляют rto_next_cpu() перезапустить свою работу.
поиск от -1. Когда CPU0 остается перегруженным (удовлетворяет rt_nr_migratory
&& rt_nr_total > 1), он выбирается повторно, в результате чего CPU0 ставит irq_work в очередь
себя и неоднократно отправлять собственные IPI.
Пока CPU0 остается перегруженным и
другие процессоры запускают pull_rt_tasks(), он попадает в бесконечный цикл self-IPI,
что вызывает жесткую блокировку ЦП из-за непрерывных самопрерываний. Сценарий запуска следующий:
процессор0 процессор1 процессор2
pull_rt_task
Tell_cpu_to_push
<------------irq_work_queue_on
rto_push_irq_work_func
push_rt_task
resched_curr(rq) pull_rt_task
rto_next_cpu Tell_cpu_to_push
<--------------------------atomic_inc(rto_loop_next)
rd->rto_loop != следующий
rto_next_cpu
irq_work_queue_on
rto_push_irq_work_func
Исправьте избыточный собственный IPI, отфильтровав инициирующий ЦП в rto_next_cpu(). Было проверено, что это решение эффективно устраняет ложные собственные IPI.
и предотвращать сценарии жесткой блокировки ЦП.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: sched/rt: Skip currently executing CPU in rto_next_cpu() CPU0 becomes overloaded when hosting a CPU-bound RT task, a non-CPU-bound RT task, and a CFS task stuck in kernel space. When other CPUs switch from RT to non-RT tasks, RT load balancing (LB) is triggered; with HAVE_RT_PUSH_IPI enabled, they send IPIs to CPU0 to drive the execution of rto_push_irq_work_func. During push_rt_task on CPU0, if next_task->prio < rq->donor->prio, resched_curr() sets NEED_RESCHED and after the push operation completes, CPU0 calls rto_next_cpu(). Since only CPU0 is overloaded in this scenario, rto_next_cpu() should ideally return -1 (no further IPI needed). However, multiple CPUs invoking tell_cpu_to_push() during LB increments rd->rto_loop_next. Even when rd->rto_cpu is set to -1, the mismatch between rd->rto_loop and rd->rto_loop_next forces rto_next_cpu() to restart its search from -1. With CPU0 remaining overloaded (satisfying rt_nr_migratory && rt_nr_total > 1), it gets reselected, causing CPU0 to queue irq_work to itself and send self-IPIs repeatedly. As long as CPU0 stays overloaded and other CPUs run pull_rt_tasks(), it falls into an infinite self-IPI loop, which triggers a CPU hardlockup due to continuous self-interrupts. The trigging scenario is as follows: cpu0 cpu1 cpu2 pull_rt_task tell_cpu_to_push <------------irq_work_queue_on rto_push_irq_work_func push_rt_task resched_curr(rq) pull_rt_task rto_next_cpu tell_cpu_to_push <-------------------------- atomic_inc(rto_loop_next) rd->rto_loop != next rto_next_cpu irq_work_queue_on rto_push_irq_work_func Fix redundant self-IPI by filtering the initiating CPU in rto_next_cpu(). This solution has been verified to effectively eliminate spurious self-IPIs and prevent CPU hardlockup scenarios.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 9
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
4.4.103
|
4.5
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
4.9.66
|
4.10
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
4.14.3
|
5.10.252
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.11
|
5.15.202
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.16
|
6.1.165
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.2
|
6.6.128
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.7
|
6.12.75
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.18.14
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
6.19.4
|