В ядре Linux устранена следующая уязвимость:
clocksource: используйтеmigrate_disable(), чтобы избежать вызова get_random_u32() в атомарном контексте. Следующий отчет об ошибке произошел с ядром PREEMPT_RT:
ОШИБКА: спящая функция вызывается из неверного контекста в kernel/locking/spinlock_rt.c:48.
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 2012, имя: kwatchdog
preempt_count: 1, ожидается: 0
Глубина гнезда RCU: 0, ожидаемо: 0
get_random_u32+0x4f/0x110
clocksource_verify_choose_cpus+0xab/0x1a0
clocksource_verify_percpu.part.0+0x6b/0x330
clocksource_watchdog_kthread+0x193/0x1a0
Это связано с тем, что clocksource_verify_choose_cpus() вызывается с помощью
упреждение отключено. Эта функция вызывает get_random_u32() для получения
случайные числа для выбора процессоров.
Локальная блокировка Batched_entropy_32 и/или
спин-блокировка base_crng.lock в driver/char/random.c будет получена во время
звонок. В ядре PREEMPT_RT они обе являются спящими блокировками и поэтому не могут
быть приобретены в атомарном контексте. Исправьте эту проблему, используя миграцию_disable(), чтобы разрешить smp_processor_id()
можно надежно использовать без введения атомарного контекста. preempt_disable() — это
затем вызывается после clocksource_verify_choose_cpus(), но до
измерение источника тактовой частоты выполняется во избежание непредвиденных
задержка.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: clocksource: Use migrate_disable() to avoid calling get_random_u32() in atomic context The following bug report happened with a PREEMPT_RT kernel: BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 2012, name: kwatchdog preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 get_random_u32+0x4f/0x110 clocksource_verify_choose_cpus+0xab/0x1a0 clocksource_verify_percpu.part.0+0x6b/0x330 clocksource_watchdog_kthread+0x193/0x1a0 It is due to the fact that clocksource_verify_choose_cpus() is invoked with preemption disabled. This function invokes get_random_u32() to obtain random numbers for choosing CPUs. The batched_entropy_32 local lock and/or the base_crng.lock spinlock in driver/char/random.c will be acquired during the call. In PREEMPT_RT kernel, they are both sleeping locks and so cannot be acquired in atomic context. Fix this problem by using migrate_disable() to allow smp_processor_id() to be reliably used without introducing atomic context. preempt_disable() is then called after clocksource_verify_choose_cpus() but before the clocksource measurement is being run to avoid introducing unexpected latency.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 8
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.10.50
|
5.10.235
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.12.17
|
5.13
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.13.2
|
5.15.179
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.16
|
6.1.129
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.2
|
6.6.79
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.7
|
6.12.16
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.13.4
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.14:rc1:*:*:*:*:*:*
|
— | — |