🇰🇷 한글 설명
Linux 커널의 cpuset cgroup에서 CPU 핫플러그 처리 중 경쟁 조건(race condition)이 발생합니다. CPU 오프라인 시 cpu_active_mask가 먼저 갱신되어 최상위 cpuset에 활성 CPU가 없는 순간이 생기며, 이때 guarantee_active_cpus() 호출로 NULL 포인터 역참조가 발생할 수 있습니다. 해결책으로 cs NULL 검사를 다시 추가합니다.
💡 쉬운 설명
리눅스 커널이 CPU를 끄는 도중 CPU 사용 설정을 확인하다가 잠깐 사용할 CPU가 없는 상태가 되어 시스템이 비정상 종료될 수 있는 문제입니다. 이를 막기 위해 빈 값을 검사하는 코드를 다시 넣은 수정입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
cgroup/cpuset: Handle cpu hotplug race in guarantee_active_cpus()
With commit 2125c0034c5d ("cgroup/cpuset: Make cpuset hotplug processing
synchronous"), the cpuset hotplug operation becomes synchronous. That
commit also removes the code that handles race between cpuset_hotplug_work
and cpu hotplug notifier with the assumption that race is now gone.
Later commit 7a0aabd9ce69 ("cgroup/cpuset: Always use cpu_active_mask")
updates the cpuset code to always use cpu_active_mask instead of
cpu_online_mask in some places including guarantee_online_cpus() which
is renamed to guarantee_active_cpus() in that commit.
In the case of CPU offline operation, cpu_active_mask is updated
first in sched_cpu_deactivate() to remove the offline CPU before
cpuset_handle_hotplug() is called to update the effective_cpus of the
affected cpusets. The cpu_online_mask is updated after that near the end
of the offline operation to remove the offline CPU. As a result, the race
comes back and the top cpuset may not have any active CPU leading to NULL
pointer dereference during the race window when guarantee_active_cpus()
is called after cpu_active_mask is updated to remove the CPU to be torn
down but before cpuset_handle_hotplug() is able to properly update the
effective_cpus of the top cpuset.
Fix this by adding back the NULL cs check to avoid this problem.
📍 영향받는 시스템
CPU 핫플러그(동적 CPU 제거)와 cpuset cgroup을 사용하는 Linux 커널 (수정 커밋 2125c0034c5d, 7a0aabd9ce69 이후 버전)
⚔️ 공격 벡터
CPU 오프라인 전환 시점에 cpuset 관련 작업을 유발하는 로컬 권한 사용자 또는 비정상 시스템 상태에 의한 커널 패닉(서비스 거부)
🛡️ 대응 방법
해당 패치가 포함된 최신 Linux 커널 버전으로 업데이트하고 재부팅합니다.
🔧 검증 코드
출력된 커널 버전을 배포판의 보안 공지나 커널 changelog와 대조하여 이 패치가 포함되었는지 확인합니다. 패치가 없는 구버전이면 업데이트가 필요합니다.