🇰🇷 한글 설명
Linux 커널의 KVM SVM 구현에서 CPU 핫플러그 발생 시 ASID(Address Space Identifier) 충돌이 발생하는 취약점입니다. CPU가 오프라인 후 다시 온라인이 될 때 ASID 생성 번호가 초기화되어, 서로 다른 VM의 vCPU가 동일한 ASID를 공유하게 되어 잘못된 TLB 번역을 사용할 수 있습니다.
💡 쉬운 설명
컴퓨터의 CPU 부품이 교체되거나 재설정되는 과정에서, 서로 다른 가상 컴퓨터가 같은 식별 번호를 갖게 되는 오류입니다. 이로 인해 한 가상 컴퓨터의 데이터가 다른 가상 컴퓨터에 잘못 전달되거나 시스템 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
KVM: SVM: Bump asid_generation on CPU online to avoid ASID collision after hotplug
If a vCPU stays scheduled out (or blocked) while the last pCPU it ran
on goes through a hotplug cycle (online->offline->online), and the vCPU
then resumes execution on the same pCPU, then it is possible for it to
run with an ASID that has now been assigned to a different vCPU,
resulting in stale TLB translations being used.
svm_enable_virtualization_cpu() resets asid_generation to 1 and sets
next_asid to max_asid + 1 on every CPU online event, including hotplug
cycles. Because next_asid starts beyond the pool boundary, the first
call to new_asid() after an online event always wraps the pool,
incrementing asid_generation to 2 and assigning ASIDs starting from
min_asid.
Consider two vCPUs from different VMs, vCPU-A pinned to CPU-X holding
asid_generation=2 and ASID=N from before the hotplug event:
1. CPU-X goes offline and back online: asid_generation resets to 1,
next_asid = max_asid + 1.
2. One or more vCPUs migrate to CPU-X and call new_asid(), wrapping
the pool and consuming ASIDs starting from min_asid. Eventually
vCPU-B from a different VM is assigned asid_generation=2, ASID=N
— the same ASID that vCPU-A held before the hotplug.
3. vCPU-A enters pre_svm_run() on CPU-X: current_vmcb->cpu is
unchanged so the migration branch is skipped. Its saved
asid_generation=2 matches sd->asid_generation=2, so the generation
check silently passes and vCPU-A continues running with ASID=N —
the same ASID just freshly assigned to vCPU-B.
Both vCPUs from different VMs now run on CPU-X with the same ASID,
causing them to share NPT TLB entries and producing stale translations.
The collision manifests as a KVM internal error (Suberror: 1, emulation
failure). The NPT page fault reports a faulting GPA far outside the
VM's physical memory range — a sign of stale TLB translations being
used. KVM falls back to instruction emulation, which fails on
FPU/XSave instructions (XRSTOR, STMXCSR) that the emulator does not
implement.
Fix this by incrementing asid_generation instead of resetting it to 1
in svm_enable_virtualization_cpu(). On module load, asid_generation
starts at 0 (memset) and the increment produces 1, identical to the
old behaviour. On subsequent hotplug cycles the generation advances
beyond any value a vCPU previously observed on this CPU, so the
generation check in pre_svm_run() reliably forces new_asid() on every
vCPU after every hotplug cycle.
📍 영향받는 시스템
Linux kernel (KVM SVM module 사용 환경)
⚔️ 공격 벡터
CPU 핫플러그(Hotplug) 사이클을 유도하여 서로 다른 VM 간의 ASID 충돌 및 TLB 오염 유발
🛡️ 대응 방법
svm_enable_virtualization_cpu() 함수에서 asid_generation을 1로 초기화하는 대신 값을 증가시키도록 커널 패치 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 보안 패치 버전인지 확인
💻 영향받는 소프트웨어
NVIDIA vGPU Guest Driver for Linux