🇰🇷 한글 설명
Linux 커널의 cgroup 관리 과정에서 특정 컨트롤러(perf_event, net_prio)를 반복적으로 마운트/언마운트할 때 시스템이 멈추는(Hang) 현상이 발생합니다. 이는 루트 cgroup 파괴 작업과 하위 CSS 오프라인 작업이 동일한 워크큐에서 충돌하여 발생하는 교착 상태 때문입니다.
💡 쉬운 설명
컴퓨터의 자원을 관리하는 시스템이 특정 작업을 처리하는 도중, 서로의 작업이 끝나기를 기다리며 무한히 대기하는 상태에 빠지는 문제입니다. 이로 인해 시스템이 응답하지 않고 멈출 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
cgroup: split cgroup_destroy_wq into 3 workqueues
A hung task can occur during [1] LTP cgroup testing when repeatedly
mounting/unmounting perf_event and net_prio controllers with
systemd.unified_cgroup_hierarchy=1. The hang manifests in
cgroup_lock_and_drain_offline() during root destruction.
Related case:
cgroup_fj_function_perf_event cgroup_fj_function.sh perf_event
cgroup_fj_function_net_prio cgroup_fj_function.sh net_prio
Call Trace:
cgroup_lock_and_drain_offline+0x14c/0x1e8
cgroup_destroy_root+0x3c/0x2c0
css_free_rwork_fn+0x248/0x338
process_one_work+0x16c/0x3b8
worker_thread+0x22c/0x3b0
kthread+0xec/0x100
ret_from_fork+0x10/0x20
Root Cause:
CPU0 CPU1
mount perf_event umount net_prio
cgroup1_get_tree cgroup_kill_sb
rebind_subsystems // root destruction enqueues
// cgroup_destroy_wq
// kill all perf_event css
// one perf_event css A is dying
// css A offline enqueues cgroup_destroy_wq
// root destruction will be executed first
css_free_rwork_fn
cgroup_destroy_root
cgroup_lock_and_drain_offline
// some perf descendants are dying
// cgroup_destroy_wq max_active = 1
// waiting for css A to die
Problem scenario:
1. CPU0 mounts perf_event (rebind_subsystems)
2. CPU1 unmounts net_prio (cgroup_kill_sb), queuing root destruction work
3. A dying perf_event CSS gets queued for offline after root destruction
4. Root destruction waits for offline completion, but offline work is
blocked behind root destruction in cgroup_destroy_wq (max_active=1)
Solution:
Split cgroup_destroy_wq into three dedicated workqueues:
cgroup_offline_wq – Handles CSS offline operations
cgroup_release_wq – Manages resource release
cgroup_free_wq – Performs final memory deallocation
This separation eliminates blocking in the CSS free path while waiting for
offline operations to complete.
[1] https://github.com/linux-test-project/ltp/blob/master/runtest/controllers
📍 영향받는 시스템
Linux kernel (systemd.unified_cgroup_hierarchy=1 설정 및 특정 cgroup 컨트롤러 사용 시)
⚔️ 공격 벡터
로컬 사용자가 특정 cgroup 컨트롤러를 반복적으로 마운트 및 언마운트하여 시스템 교착 상태 유도 (DoS)
🛡️ 대응 방법
cgroup_destroy_wq를 세 개의 전용 워크큐(offline, release, free)로 분리하여 적용된 최신 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인