🇰🇷 한글 설명
Linux 커널의 KVM(x86)에서 발생한 취약점으로, 중첩 가상화(Nested VM) 환경에서 인터럽트 처리 중 레이스 컨디션이 발생할 수 있습니다. 송신 vCPU와 대상 vCPU 간의 동기화 문제로 인해 PIR(Posted Interrupt Request)이 비어 있음에도 PID.ON이 설정된 경우, IRR(Interrupt Request Register) 스캔이 누락되어 잘못된 인터럽트 상태를 보고하고 경고(WARNING)를 발생시킵니다.
💡 쉬운 설명
가상 컴퓨터를 여러 겹으로 실행할 때, 컴퓨터 간의 신호 전달 과정에서 타이밍 차이로 인해 시스템이 일시적으로 혼란을 겪는 문제입니다. 이로 인해 시스템 경고가 발생하거나 불필요한 자원이 낭비될 수 있지만, 신호 자체가 사라지지는 않습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
KVM: x86: Do IRR scan in __kvm_apic_update_irr even if PIR is empty
Fall back to apic_find_highest_vector() when PID.ON is set but PIR
turns out to be empty, to correctly report the highest pending interrupt
from the existing IRR.
In a nested VM stress test, the following WARNING fires in
vmx_check_nested_events() when kvm_cpu_has_interrupt() reports a pending
interrupt but the subsequent kvm_apic_has_interrupt() (which invokes
vmx_sync_pir_to_irr() again) returns -1:
WARNING: CPU: 99 PID: 57767 at arch/x86/kvm/vmx/nested.c:4449 vmx_check_nested_events+0x6bf/0x6e0 [kvm_intel]
Call Trace:
kvm_check_and_inject_events
vcpu_enter_guest.constprop.0
vcpu_run
kvm_arch_vcpu_ioctl_run
kvm_vcpu_ioctl
__x64_sys_ioctl
do_syscall_64
entry_SYSCALL_64_after_hwframe
The root cause is a race between vmx_sync_pir_to_irr() on the target vCPU
and __vmx_deliver_posted_interrupt() on a sender vCPU. The sender
performs two individually-atomic operations that are not a single
transaction:
1. pi_test_and_set_pir(vector) -- sets the PIR bit
2. pi_test_and_set_on() -- sets PID.ON
The following interleaving triggers the bug:
Sender vCPU (IPI): Target vCPU (1st sync_pir_to_irr):
B1: set PIR[vector]
A1: pi_clear_on()
A2: pi_harvest_pir() -> sees B1 bit
A3: xchg() -> consumes bit, PIR=0
(1st sync returns correct max_irr)
B2: set PID.ON = 1
Target vCPU (2nd sync_pir_to_irr):
C1: pi_test_on() -> TRUE (from B2)
C2: pi_clear_on() -> ON=0
C3: pi_harvest_pir() -> PIR empty
C4: *max_irr = -1, early return
IRR NOT SCANNED
The interrupt is not lost (it resides in the IRR from the first sync and
is recovered on the next vcpu_enter_guest() iteration), but the incorrect
max_irr causes a spurious WARNING and a wasted L2 VM-Enter/VM-Exit cycle.
📍 영향받는 시스템
Linux kernel (KVM x86 architecture using Intel VMX)
⚔️ 공격 벡터
중첩 가상화 환경에서 특정 타이밍의 인터럽트 발생을 유도하여 시스템 경고 및 성능 저하 유발 (Local/Denial of Service)
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 __kvm_apic_update_irr 함수 내 IRR 스캔 로직을 수정해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인합니다.