🇰🇷 한글 설명
Linux 커널의 작업 스케줄러(sched/fair)에서 zero_vruntime 추적 버그로, 여러 작업이 yield를 반복할 때 부정확한 스케줄링으로 인해 시스템 성능 저하 및 예기치 않은 동작이 발생할 수 있습니다. 특정 환경에서 tick이 cgroup을 적시에 처리하지 못할 경우 더욱 심각해집니다.
💡 쉬운 설명
Linux 커널이 프로그램들을 실행할 순서를 정할 때의 버그로, 프로그램들이 자주 양보할 때 잘못된 순서로 실행되어 시스템이 느려질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
sched/fair: Fix zero_vruntime tracking fix
John reported that stress-ng-yield could make his machine unhappy and
managed to bisect it to commit b3d99f43c72b ("sched/fair: Fix
zero_vruntime tracking").
The combination of yield and that commit was specific enough to
hypothesize the following scenario:
Suppose we have 2 runnable tasks, both doing yield. Then one will be
eligible and one will not be, because the average position must be in
between these two entities.
Therefore, the runnable task will be eligible, and be promoted a full
slice (all the tasks do is yield after all). This causes it to jump over
the other task and now the other task is eligible and current is no
longer. So we schedule.
Since we are runnable, there is no {de,en}queue. All we have is the
__{en,de}queue_entity() from {put_prev,set_next}_task(). But per the
fingered commit, those two no longer move zero_vruntime.
All that moves zero_vruntime are tick and full {de,en}queue.
This means, that if the two tasks playing leapfrog can reach the
critical speed to reach the overflow point inside one tick's worth of
time, we're up a creek.
Additionally, when multiple cgroups are involved, there is no guarantee
the tick will in fact hit every cgroup in a timely manner. Statistically
speaking it will, but that same statistics does not rule out the
possibility of one cgroup not getting a tick for a significant amount of
time -- however unlikely.
Therefore, just like with the yield() case, force an update at the end
of every slice. This ensures the update is never more than a single
slice behind and the whole thing is within 2 lag bounds as per the
comment on entity_key().
📍 영향받는 시스템
Linux kernel 5.x-6.x versions without sched/fair scheduler fix
⚔️ 공격 벡터
Local DoS through stress-ng-yield or workloads causing repeated task yields triggering scheduler leapfrogging
🛡️ 대응 방법
Update Linux kernel with sched/fair zero_vruntime tracking fix patch applied
🔧 검증 코드
커널 버전 5.x 이상 확인; 취약 버전은 yield 부하에서 성능 저하 및 스케줄링 불안정 현상 발생
uname -r | grep -oP '^\d+\.\d+'