В ядре Linux устранена следующая уязвимость:
MIPS: smp: сообщить об умирающем ЦП в RCU в stop_this_cpu()
smp_send_stop() паркует все вторичные процессоры в stop_this_cpu(). Функция
отмечает процессор в автономном режиме для планировщика через set_cpu_online(false), но
никогда не сообщает RCU, поэтому RCU продолжает ожидать от процессоров состояния покоя
которые теперь вращаются вечно с отключенными прерываниями. Пока ничего не ожидает льготного периода RCU после smp_send_stop()
это безвредно, поэтому и осталось незамеченным.
С момента совершения
91840be8f710 («irq_work: исправлено использование после освобождения в irq_work_single() на PREEMPT_RT»)
однако irq_work_sync() вызываетsync_rcu() на архитектурах без
собственный IPI irq_work, т. е. где Arch_irq_work_has_interrupt() возвращает
ложь. Это общее ассемблерное значение по умолчанию, используемое MIPS. Любой irq_work_sync()
выдается в пути перезагрузки/выключения после smp_send_stop(), а затем блокируется
льготный период, который никогда не может завершиться, зависая при перезагрузке:
ВНИМАНИЕ: ЦП: 0 PID: 15 в ядре/irq_work.c:144 irq_work_queue_on
...
rcu: ИНФОРМАЦИЯ: rcu_sched обнаружил зависания процессоров/задач:
rcu: отключенный ЦП 1 блокирует текущий GP.
rcu: отключенный ЦП 2 блокирует текущий GP.
rcu: отключенный ЦП 3 блокирует текущий GP.
Эта проблема была замечена на нескольких коммутаторах Realtek MIPS SoC (MIPS
interAptiv) и появился во время обновления ядра в OpenWrt из
С 6.18.33 по 6.18.34, после бэкпорта патча в стабильную версию 6.18.
филиал. Патч также был полностью перенесен обратно в версию 6.1. Вызовите rcutree_report_cpu_dead() после отключения прерываний, зеркально отразив
общий автономный путь горячего подключения ЦП, поэтому RCU перестает ждать припаркованные ЦП
и льготные периоды все еще могут завершиться. MIPS отключает все процессоры здесь
без использования механизма горячего подключения ЦП, поэтому этот отчет не является
выдано иначе.
Сообщение об умирающем ЦП в RCU за пределами обычного горячего подключения
Автономный путь не является беспрецедентным: Arm64 делает то же самое в cpu_die_early(). Это исключение для процессора, который подключался к сети и прерывал работу.
вызов, а не действие по выключению по умолчанию, как в MIPS.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: MIPS: smp: report dying CPU to RCU in stop_this_cpu() smp_send_stop() parks all secondary CPUs in stop_this_cpu(). The function marks the CPU offline for the scheduler via set_cpu_online(false) but never informs RCU, so RCU keeps expecting a quiescent state from CPUs that are now spinning forever with interrupts disabled. As long as nothing waits for an RCU grace period after smp_send_stop() this is harmless, which is why it went unnoticed. Since commit 91840be8f710 ("irq_work: Fix use-after-free in irq_work_single() on PREEMPT_RT") however, irq_work_sync() calls synchronize_rcu() on architectures without an irq_work self-IPI, i.e. where arch_irq_work_has_interrupt() returns false. That is the asm-generic default used by MIPS. Any irq_work_sync() issued in the reboot/shutdown path after smp_send_stop() then blocks on a grace period that can never complete, hanging the reboot: WARNING: CPU: 0 PID: 15 at kernel/irq_work.c:144 irq_work_queue_on ... rcu: INFO: rcu_sched detected stalls on CPUs/tasks: rcu: Offline CPU 1 blocking current GP. rcu: Offline CPU 2 blocking current GP. rcu: Offline CPU 3 blocking current GP. This issue was noticed on several Realtek MIPS switch SoCs (MIPS interAptiv) and came up during kernel bump downstream in OpenWrt from 6.18.33 to 6.18.34, after the backport of the patch to the 6.18 stable branch. The patch also has been backported all the way back to 6.1. Call rcutree_report_cpu_dead() once interrupts are disabled, mirroring the generic CPU-hotplug offline path, so RCU stops waiting on the parked CPUs and grace periods can still complete. MIPS shuts down all CPUs here without going through the CPU-hotplug mechanism, so this report is not otherwise issued. Reporting a dying CPU to RCU outside the regular hotplug offline path is not unprecedented: arm64 does the same in cpu_die_early(). There it is an exception for a CPU that was coming online and is aborting bringup, rather than the default shutdown action as on MIPS.
Характеристики атаки
Последствия
Строка CVSS v3.1
Уязвимые продукты 11
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.1.175
|
6.1.178
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.6.142
|
6.6.145
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.12.92
|
6.12.95
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.18.34
|
6.18.38
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
7.0.11
|
7.1
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
7.1.1
|
7.1.3
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:-:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc4:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc5:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc6:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc7:*:*:*:*:*:*
|
— | — |