🇰🇷 한글 설명
Linux 커널의 스케줄러 MMCID 시스템에서 동시 fork 작업 중 발생하는 경쟁 상태 취약점. 새로운 태스크가 스레드 목록에 나타나기 전에 MMCID 사용자로 등록되어, CID 할당 실패로 인한 시스템 정지 발생 가능.
💡 쉬운 설명
Linux가 여러 프로그램을 동시에 실행할 때 발생하는 조율 오류로, 시스템이 멈출 수 있습니다. 이는 매우 드문 상황에서 발생하는 기술적 결함입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
sched/mmcid: Prevent CID stalls due to concurrent forks
A newly forked task is accounted as MMCID user before the task is visible
in the process' thread list and the global task list. This creates the
following problem:
CPU1 CPU2
fork()
sched_mm_cid_fork(tnew1)
tnew1->mm.mm_cid_users++;
tnew1->mm_cid.cid = getcid()
-> preemption
fork()
sched_mm_cid_fork(tnew2)
tnew2->mm.mm_cid_users++;
// Reaches the per CPU threshold
mm_cid_fixup_tasks_to_cpus()
for_each_other(current, p)
....
As tnew1 is not visible yet, this fails to fix up the already allocated CID
of tnew1. As a consequence a subsequent schedule in might fail to acquire a
(transitional) CID and the machine stalls.
Move the invocation of sched_mm_cid_fork() after the new task becomes
visible in the thread and the task list to prevent this.
This also makes it symmetrical vs. exit() where the task is removed as CID
user before the task is removed from the thread and task lists.
📍 영향받는 시스템
Linux kernel 2.6.32 이후 버전 (스케줄러 MMCID 기능이 포함된 모든 배포판)
⚔️ 공격 벡터
동시 fork() 시스템 콜 반복 실행으로 경쟁 상태 유발
🛡️ 대응 방법
커널 패치 적용 또는 최신 커널 버전으로 업데이트
🔧 검증 코드
커널 버전 확인 후 MMCID fork 함수 이동 패치 적용 여부 확인 (커널 소스 코드 리포지토리에서)
uname -r && git log --oneline --grep='sched_mm_cid_fork' 2>/dev/null | head -1