🇰🇷 한글 설명
Linux 커널의 sched_ext에서 fair 클래스 작업에 의한 과부하 상황에서 scx_enable() 함수가 무한정 대기(starvation)되어 시스템이 멈출 수 있는 취약점입니다. 해결책으로 fair 및 ext 클래스에 의해 우선순위가 낮아지지 않는 RT 커널 스레드(SCHED_FIFO)를 통해 enable 작업을 처리하도록 개선되었습니다.
💡 쉬운 설명
Linux 커널의 작업 스케줄러가 과부하 상태에서 특정 활성화 작업이 영구적으로 무시되어 시스템이 응답하지 않는 문제입니다. 우선순위가 높은 커널 스레드를 사용하여 이 작업을 보호하도록 수정되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
sched_ext: Fix starvation of scx_enable() under fair-class saturation
During scx_enable(), the READY -> ENABLED task switching loop changes the
calling thread's sched_class from fair to ext. Since fair has higher
priority than ext, saturating fair-class workloads can indefinitely starve
the enable thread, hanging the system. This was introduced when the enable
path switched from preempt_disable() to scx_bypass() which doesn't protect
against fair-class starvation. Note that the original preempt_disable()
protection wasn't complete either - in partial switch modes, the calling
thread could still be starved after preempt_enable() as it may have been
switched to ext class.
Fix it by offloading the enable body to a dedicated system-wide RT
(SCHED_FIFO) kthread which cannot be starved by either fair or ext class
tasks. scx_enable() lazily creates the kthread on first use and passes the
ops pointer through a struct scx_enable_cmd containing the kthread_work,
then synchronously waits for completion.
The workfn runs on a different kthread from sch->helper (which runs
disable_work), so it can safely flush disable_work on the error path
without deadlock.
📍 영향받는 시스템
Linux 커널 sched_ext 기능이 활성화된 시스템 (일반적으로 최신 Linux 5.19+ 커널)
⚔️ 공격 벡터
로컬 권한 상승 또는 DoS: fair 클래스 워크로드 포화로 시스템 행(hang) 유도
🛡️ 대응 방법
최신 Linux 커널 패치 적용 또는 sched_ext 기능 비활성화
🔧 검증 코드
CONFIG_SCHED_CLASS_EXT=y가 출력되면 sched_ext가 활성화된 상태이며, 패치 적용 여부는 커널 버전(uname -r)으로 확인해야 합니다.
grep -i 'CONFIG_SCHED_CLASS_EXT\|sched_ext' /boot/config-$(uname -r) 2>/dev/null || echo 'Not configured'