В ядре Linux устранена следующая уязвимость:
расписание/срок: исправлено отсутствие ENQUEUE_REPLENISH во время понижения производительности PI. Запуск стресс-нг --schedpolicy 0 на ядре RT на большой машине
может привести к следующим ПРЕДУПРЕЖДЕНИЯМ (отредактировано).
sched: задача с отключенным ускорением DL. PID 22725: флаг REPLENISH отсутствует.
ВНИМАНИЕ: CPU: 93 PID: 0 в kernel/sched/deadline.c:239 dequeue_task_dl+0x15c/0x1f8
... (переполнение running_bw)
Трассировка звонков:
dequeue_task_dl+0x15c/0x1f8 (P)
dequeue_task+0x80/0x168
deactivate_task+0x24/0x50
push_dl_task+0x264/0x2e0
dl_task_timer+0x1b0/0x228
__hrtimer_run_queues+0x188/0x378
hrtimer_interrupt+0xfc/0x260
... Проблема в том, что когда задача SCHED_DEADLINE (держатель блокировки)
изменен на класс с более низким приоритетом с помощью sched_setscheduler(), это может
не могут должным образом унаследовать параметры потенциальных доноров DEADLINE
если он еще не унаследовал их в прошлом (более короткий срок, чем
донора на тот момент). Это может привести к учету пропускной способности
повреждение, поскольку enqueue_task_dl() не распознает держателя блокировки как
усилен.
Сценарий имеет место, когда:
1. Задача DEADLINE (донор) блокируется во мьютексе PI, удерживаемым другим
Задача DEADLINE (холдер), но холдер не наследует параметры
(например, у него уже есть более короткий срок)
2. sched_setscheduler() меняет держателя с DEADLINE на более низкий
класс, все еще удерживая мьютекс
3. Держатель теперь должен наследовать параметры DEADLINE от донора.
и быть поставленным в очередь с ENQUEUE_REPLENISH, но этого не происходит
Исправьте эту проблему, представив __setscheduler_dl_pi(), который определяет, когда
Задача DEADLINE (правильная или усиленная) переносится на более низкий срок.
приоритетный класс.
В случае, если функция наследует задачу DEADLINE
параметры донора (pi_se) и устанавливает флаг ENQUEUE_REPLENISH в значение
обеспечить правильный учет пропускной способности во время следующей операции постановки в очередь.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: sched/deadline: Fix missing ENQUEUE_REPLENISH during PI de-boosting Running stress-ng --schedpolicy 0 on an RT kernel on a big machine might lead to the following WARNINGs (edited). sched: DL de-boosted task PID 22725: REPLENISH flag missing WARNING: CPU: 93 PID: 0 at kernel/sched/deadline.c:239 dequeue_task_dl+0x15c/0x1f8 ... (running_bw underflow) Call trace: dequeue_task_dl+0x15c/0x1f8 (P) dequeue_task+0x80/0x168 deactivate_task+0x24/0x50 push_dl_task+0x264/0x2e0 dl_task_timer+0x1b0/0x228 __hrtimer_run_queues+0x188/0x378 hrtimer_interrupt+0xfc/0x260 ... The problem is that when a SCHED_DEADLINE task (lock holder) is changed to a lower priority class via sched_setscheduler(), it may fail to properly inherit the parameters of potential DEADLINE donors if it didn't already inherit them in the past (shorter deadline than donor's at that time). This might lead to bandwidth accounting corruption, as enqueue_task_dl() won't recognize the lock holder as boosted. The scenario occurs when: 1. A DEADLINE task (donor) blocks on a PI mutex held by another DEADLINE task (holder), but the holder doesn't inherit parameters (e.g., it already has a shorter deadline) 2. sched_setscheduler() changes the holder from DEADLINE to a lower class while still holding the mutex 3. The holder should now inherit DEADLINE parameters from the donor and be enqueued with ENQUEUE_REPLENISH, but this doesn't happen Fix the issue by introducing __setscheduler_dl_pi(), which detects when a DEADLINE (proper or boosted) task gets setscheduled to a lower priority class. In case, the function makes the task inherit DEADLINE parameters of the donoer (pi_se) and sets ENQUEUE_REPLENISH flag to ensure proper bandwidth accounting during the next enqueue operation.