🇰🇷 한글 설명
Linux 커널의 blk-cgroup 구성 요소에서 정책 활성화와 blkcg 삭제 작업 간의 경쟁 상태(Race Condition)로 인해 Use-After-Free 및 메모리 누수 취약점이 발생합니다. 정책 활성화 중 메모리 할당 실패로 인한 롤백 과정에서 이미 삭제된 블록 cgroup의 데이터에 접근하거나, 삭제 중인 cgroup에 새로운 데이터를 할당하여 메모리 누수가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터의 저장 장치를 관리하는 규칙을 바꾸는 도중에, 해당 규칙을 사용하는 대상이 동시에 삭제되면서 시스템이 이미 사라진 정보를 참조하여 오류가 발생하는 문제입니다. 이로 인해 시스템이 멈추거나 메모리가 낭비될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
blk-cgroup: fix race between policy activation and blkg destruction
When switching an IO scheduler on a block device, blkcg_activate_policy()
allocates blkg_policy_data (pd) for all blkgs attached to the queue.
However, blkcg_activate_policy() may race with concurrent blkcg deletion,
leading to use-after-free and memory leak issues.
The use-after-free occurs in the following race:
T1 (blkcg_activate_policy):
- Successfully allocates pd for blkg1 (loop0->queue, blkcgA)
- Fails to allocate pd for blkg2 (loop0->queue, blkcgB)
- Enters the enomem rollback path to release blkg1 resources
T2 (blkcg deletion):
- blkcgA is deleted concurrently
- blkg1 is freed via blkg_free_workfn()
- blkg1->pd is freed
T1 (continued):
- Rollback path accesses blkg1->pd->online after pd is freed
- Triggers use-after-free
In addition, blkg_free_workfn() frees pd before removing the blkg from
q->blkg_list. This allows blkcg_activate_policy() to allocate a new pd
for a blkg that is being destroyed, leaving the newly allocated pd
unreachable when the blkg is finally freed.
Fix these races by extending blkcg_mutex coverage to serialize
blkcg_activate_policy() rollback and blkg destruction, ensuring pd
lifecycle is synchronized with blkg list visibility.
📍 영향받는 시스템
Linux Kernel (blk-cgroup 관련 모듈을 사용하는 시스템)
⚔️ 공격 벡터
로컬 권한을 가진 공격자가 I/O 스케줄러 변경과 cgroup 삭제를 동시에 유도하여 메모리 오류 유발
🛡️ 대응 방법
blkcg_mutex 범위를 확장하여 정책 활성화 롤백과 cgroup 삭제 과정을 직렬화하도록 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 최신 보안 패치 버전인지 확인합니다.