🇰🇷 한글 설명
Linux 커널의 blk-cgroup 구성 요소에서 IO 스케줄러를 전환할 때 발생하는 Use-After-Free 취약점입니다. blkcg_activate_policy() 함수가 동시에 진행되는 blkcg 삭제 작업과 경합을 일으켜 이미 해제된 메모리 영역인 rcu_accelerate_cbs에 접근할 수 있습니다.
💡 쉬운 설명
컴퓨터의 데이터 저장 장치를 관리하는 프로그램에서, 데이터 관리 도구가 삭제되는 도중에 동시에 다른 명령이 내려져 이미 사라진 정보를 다시 사용하려고 시도하는 오류입니다. 이로 인해 시스템이 멈추거나 보안 문제가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
blk-cgroup: skip dying blkg in blkcg_activate_policy()
When switching IO schedulers on a block device, blkcg_activate_policy()
can race with concurrent blkcg deletion, leading to a use-after-free in
rcu_accelerate_cbs.
T1: T2:
blkg_destroy
kill(&blkg->refcnt) // blkg->refcnt=1->0
blkg_release // call_rcu(__blkg_release)
...
blkg_free_workfn
->pd_free_fn(pd)
elv_iosched_store
elevator_switch
...
iterate blkg list
blkg_get(blkg) // blkg->refcnt=0->1
list_del_init(&blkg->q_node)
blkg_put(pinned_blkg) // blkg->refcnt=1->0
blkg_release // call_rcu again
rcu_accelerate_cbs // uaf
Fix this by checking hlist_unhashed(&blkg->blkcg_node) before getting
a reference to the blkg. This is the same check used in blkg_destroy()
to detect if a blkg has already been destroyed. If the blkg is already
unhashed, skip processing it since it's being destroyed.
📍 영향받는 시스템
Linux Kernel (blk-cgroup 관련 모듈을 사용하는 시스템)
⚔️ 공격 벡터
특권 권한을 가진 사용자가 IO 스케줄러를 빈번하게 변경하여 커널 내의 경합 상태(Race Condition)를 유도함
🛡️ 대응 방법
커널 패치를 적용하여 blkg 참조를 가져오기 전 hlist_unhashed 상태를 확인하도록 업데이트함
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 취약점이 해결된 최신 패치 버전인지 확인합니다.