🇰🇷 한글 설명
리눅스 커널의 스케줄러(sched/core)에서 pick_task() 함수가 rq 락을 해제할 때 발생하는 동기화 오류 문제입니다. 락이 해제된 사이 다른 프로세스가 개입하여 스케줄링 상태를 변경하면, 잘못된 상태로 작업이 수행되거나 계측 데이터가 왜곡될 수 있습니다.
💡 쉬운 설명
컴퓨터의 두뇌 역할을 하는 커널이 작업을 순서대로 처리하는 과정에서, 잠시 쉬는 사이에 다른 작업이 끼어들어 순서가 꼬이는 문제입니다. 이로 인해 시스템의 작업 처리 효율이 떨어지거나 예상치 못한 동작이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
sched/core: Handle pick_task() releasing the rq lock
Core scheduling's pick_next_task() breaks when a ->pick_task()
implementation can release the rq lock. The selection state derived on entry
is only valid while the lock is held continuously. Once a pick can drop the
lock, an interleaving selection can invalidate all of it: the single-CPU
fast path can commit an uncookied pick although the core went cookied during
the release, and forceidle committed by the interleaving selection skews the
restarted pass's accounting.
Fix it by restarting the whole selection when a pick returns RETRY_TASK
after releasing the lock: a single restart point above the state derivation
replaces the per-loop restart labels, so a retry picks up state committed by
interleaving selections and accounts and resets forceidle like a fresh
selection would.
need_sync and fi_before latch across retries. Clock validity can't be
re-derived - there is no program-ordered way to tell whether the own and
core rq clocks are still updated after the lock was released, as other
lockers' pin cycles may or may not have invalidated them. When restarting,
clear core_clock_updated so that the sibling loop re-updates the core rq,
and update the own rq clock if invalidated.
📍 영향받는 시스템
Linux Kernel (Core Scheduling 기능이 활성화된 버전)
⚔️ 공격 벡터
로컬 공격자가 정교하게 설계된 스케줄링 패턴을 통해 커널의 스케줄링 상태를 교란하여 시스템 자원 관리 오류 유도
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 pick_task()의 락 해제 시 재시도 로직 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인