🇰🇷 한글 설명
리눅스 커널 블록 계층의 rq_qos 프레임워크에서, 동일한 타입의 rq_qos가 한 디스크 큐에 두 번 이상 추가될 수 있는 문제가 수정되었습니다. io.cost.qos 파일이 두 CPU에서 동시에 쓰여질 때 두 개의 iocost 인스턴스가 같은 디스크에서 동작하여 ioc_timer_fn에서 리스트 추가/삭제 손상(list corruption)과 크래시가 발생할 수 있었습니다.
💡 쉬운 설명
디스크 입출력 속도를 제어하는 기능이 두 번 설정되면서 내부 데이터 목록이 꼬여 시스템이 멈추거나 충돌할 수 있었습니다. 이번 수정으로 같은 종류의 제어 기능이 한 디스크에 중복 등록되지 않도록 막습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
block: don't allow the same type rq_qos add more than once
In our test of iocost, we encountered some list add/del corruptions of
inner_walk list in ioc_timer_fn.
The reason can be described as follows:
cpu 0 cpu 1
ioc_qos_write ioc_qos_write
ioc = q_to_ioc(queue);
if (!ioc) {
ioc = kzalloc();
ioc = q_to_ioc(queue);
if (!ioc) {
ioc = kzalloc();
...
rq_qos_add(q, rqos);
}
...
rq_qos_add(q, rqos);
...
}
When the io.cost.qos file is written by two cpus concurrently, rq_qos may
be added to one disk twice. In that case, there will be two iocs enabled
and running on one disk. They own different iocgs on their active list. In
the ioc_timer_fn function, because of the iocgs from two iocs have the
same root iocg, the root iocg's walk_list may be overwritten by each other
and this leads to list add/del corruptions in building or destroying the
inner_walk list.
And so far, the blk-rq-qos framework works in case that one instance for
one type rq_qos per queue by default. This patch make this explicit and
also fix the crash above.
📍 영향받는 시스템
Linux 커널 블록 계층의 iocost(io.cost) 기능을 사용하는 시스템 (수정 이전 커널 버전 전반)
⚔️ 공격 벡터
로컬 권한을 가진 사용자가 io.cost.qos 파일에 두 프로세스에서 동시에 쓰기를 수행해 레이스 컨디션을 유발하는 방식이며, 주로 시스템 불안정성(DoS)을 일으킵니다.
🛡️ 대응 방법
패치가 포함된 최신 Linux 커널로 업데이트하거나 배포판 보안 업데이트를 적용하고 재부팅하세요.
🔧 검증 코드
출력된 커널 버전이 해당 CVE 패치가 포함된 안정 버전 이상인지 배포판 보안 공지로 확인하고, CONFIG_BLK_CGROUP_IOCOST 등 iocost 관련 설정 여부로 이 기능의 사용 가능성을 판단합니다.
uname -r; grep -i iocost /boot/config-$(uname -r) 2>/dev/null; cat /sys/block/*/queue/wbt_lat_usec 2>/dev/null | head -1