В ядре Linux устранена следующая уязвимость:
iommu/vt-d: исправлено подозрительное использование RCU. Commit <d74169ceb0d2> («iommu/vt-d: выделить прерывания по ошибке DMAR
локально") перенес вызов метода Enable_drhd_fault_handling() в код
путь, который не содержит блокировок при прохождении списка drhd. Исправить
это, гарантируя, что блокировка dmar_global_lock удерживается при прохождении
список дрхд.
Без этого исправления выдается следующее предупреждение:
============================
ВНИМАНИЕ: подозрительное использование RCU
6.14.0-rc3 #55 Не испорчено
-----------------------------
driver/iommu/intel/dmar.c:2046 Список RCU просматривается в разделе, не предназначенном для чтения!
другая информация, которая может помочь нам отладить это:
rcu_scheduler_active = 1, debug_locks = 1
2 замка, удерживаемые cpuhp/1/23:
#0: ffffffff84a67c50 (cpu_hotplug_lock){++++}-{0:0}, по адресу: cpuhp_thread_fun+0x87/0x2c0
#1: ffffffff84a6a380 (cpuhp_state-up){+.+.}-{0:0}, по адресу: cpuhp_thread_fun+0x87/0x2c0
обратная трассировка стека:
ЦП: 1 UID: 0 PID: 23 Связь: cpuhp/1 Не испорчен 6.14.0-rc3 #55
Отслеживание вызова:
<ЗАДАЧА>
dump_stack_lvl+0xb7/0xd0
lockdep_rcu_suspicious+0x159/0x1f0
? __pfx_enable_drhd_fault_handling+0x10/0x10
Enable_drhd_fault_handling+0x151/0x180
cpuhp_invoke_callback+0x1df/0x990
cpuhp_thread_fun+0x1ea/0x2c0
smpboot_thread_fn+0x1f5/0x2e0
? __pfx_smpboot_thread_fn+0x10/0x10
kthread+0x12a/0x2d0
? __pfx_kthread+0x10/0x10
ret_from_fork+0x4a/0x60
? __pfx_kthread+0x10/0x10
ret_from_fork_asm+0x1a/0x30
</TASK>
Удержание блокировки в Enable_drhd_fault_handling() вызывает появление блокировки блокировки
о возможной взаимоблокировке между dmar_global_lock и cpu_hotplug_lock. Этого можно избежать, если не удерживать dmar_global_lock при вызове.
iommu_device_register(), который инициирует процесс проверки устройства.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: iommu/vt-d: Fix suspicious RCU usage Commit <d74169ceb0d2> ("iommu/vt-d: Allocate DMAR fault interrupts locally") moved the call to enable_drhd_fault_handling() to a code path that does not hold any lock while traversing the drhd list. Fix it by ensuring the dmar_global_lock lock is held when traversing the drhd list. Without this fix, the following warning is triggered: ============================= WARNING: suspicious RCU usage 6.14.0-rc3 #55 Not tainted ----------------------------- drivers/iommu/intel/dmar.c:2046 RCU-list traversed in non-reader section!! other info that might help us debug this: rcu_scheduler_active = 1, debug_locks = 1 2 locks held by cpuhp/1/23: #0: ffffffff84a67c50 (cpu_hotplug_lock){++++}-{0:0}, at: cpuhp_thread_fun+0x87/0x2c0 #1: ffffffff84a6a380 (cpuhp_state-up){+.+.}-{0:0}, at: cpuhp_thread_fun+0x87/0x2c0 stack backtrace: CPU: 1 UID: 0 PID: 23 Comm: cpuhp/1 Not tainted 6.14.0-rc3 #55 Call Trace: <TASK> dump_stack_lvl+0xb7/0xd0 lockdep_rcu_suspicious+0x159/0x1f0 ? __pfx_enable_drhd_fault_handling+0x10/0x10 enable_drhd_fault_handling+0x151/0x180 cpuhp_invoke_callback+0x1df/0x990 cpuhp_thread_fun+0x1ea/0x2c0 smpboot_thread_fn+0x1f5/0x2e0 ? __pfx_smpboot_thread_fn+0x10/0x10 kthread+0x12a/0x2d0 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x4a/0x60 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30 </TASK> Holding the lock in enable_drhd_fault_handling() triggers a lockdep splat about a possible deadlock between dmar_global_lock and cpu_hotplug_lock. This is avoided by not holding dmar_global_lock when calling iommu_device_register(), which initiates the device probe process.
Характеристики атаки
Последствия
Строка CVSS v3.1
Уязвимые продукты 6
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.10
|
6.12.18
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.13.6
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.14:rc1:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.14:rc2:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.14:rc3:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.14:rc4:*:*:*:*:*:*
|
— | — |