🇰🇷 한글 설명
Linux 커널의 resctrl 파일 시스템에서 도메인이 제거될 때 워커 스레드로 인해 Use-After-Free(UAF) 취약점이 발생할 수 있습니다. CPU 핫플러그 작업 중 도메인이 해제된 후, 대기 중이던 워커 스레드가 해제된 메모리에 접근하여 시스템 불안정이나 권한 상승을 초래할 수 있습니다.
💡 쉬운 설명
컴퓨터의 핵심 부품인 CPU 설정이 변경되는 과정에서, 이미 사라진 메모리 영역을 프로그램이 다시 사용하려고 시도하여 발생하는 오류입니다. 이로 인해 시스템이 멈추거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
fs/resctrl: Fix UAF from worker threads when domains are removed
The mbm_handle_overflow() and cqm_handle_limbo() workers read event counters
and may sleep while doing so. They are scheduled via delayed_work embedded in
struct rdt_l3_mon_domain. Architecture allocates and frees these domains from
CPU hotplug callbacks under cpus_write_lock(), and the workers acquire
cpus_read_lock() to keep the domain alive across their access.
A use-after-free can occur when a worker is blocked waiting for
cpus_read_lock() while the hotplug core holds cpus_write_lock(): the
architecture frees the rdt_l3_mon_domain that contains the worker's
work_struct. When the worker unblocks, the container_of() it performs on the
embedded work pointer dereferences freed memory.
Drop cpus_read_lock() from the workers and instead drain pending and in-flight
work synchronously before the architecture can free the domain. Since
architecture offlines the domain under cpus_write_lock() after it has been
unlinked from the RCU list and a grace period has elapsed, no new work can be
scheduled. The cancel only needs to wait out existing work. Drop
rdtgroup_mutex during CPU offline around cancel_delayed_work_sync() so that
a worker waiting on the mutex can complete before re-pinning the work on
a different CPU.
When offlining a CPU the architecture may iterate over resources in any order.
For example, the MBA control domain may be offlined before or after
a corresponding L3 monitor domain. Ensure that resctrl fs cancels the workers
no matter what order the architecture offlines the domains.
📍 영향받는 시스템
Linux Kernel (resctrl 구성 요소가 포함된 버전)
⚔️ 공격 벡터
로컬 공격자가 CPU 핫플러그(CPU Hotplug) 이벤트를 유도하여 메모리 해제 후 접근(UAF)을 발생시킴
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 resctrl 워커 스레드의 동기화 로직을 수정해야 합니다.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.