🇰🇷 한글 설명
Linux 커널 KVM의 nVMX 코드에서, VM-Entry가 아닌 경우(RSM 에뮬레이션이나 KVM_SET_NESTED_STATE 처리) L2 상태 로딩이 실패하면 vCPU의 MMU 포인터가 루트 MMU로 되돌아가지 않는 문제가 있습니다. 이로 인해 L1 실행 시 중첩 MMU가 사용되고, 중첩 상태가 해제되면 NULL 포인터 역참조로 커널 패닉이 발생할 수 있습니다. 수정으로 실패 시 MMU 포인터를 루트 MMU로 복원합니다.
💡 쉬운 설명
가상머신을 관리하는 리눅스 커널 기능에서 특정 상태 복원이 실패했을 때 잘못된 메모리 설정이 남아 시스템이 충돌할 수 있습니다. 이 결함은 가상화 호스트에서 서비스 중단을 일으킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
KVM: nVMX: Reset MMU back to the root MMU if loading L2 state fails for !VM-Entry
Reset the vCPU's MMU pointer back to the root MMU if loading L2 state fails
in the "not from VM-Entry" case, i.e. when emulating RSM or handling
KVM_SET_NESTED_STATE. Failure to unwind the MMU pointer results in KVM
trying to run L1 with a nested MMU, and is especially problematic if the
vCPU manages to free its nested state before the VM crashes. Constructing
the root for a nested EPT MMU goes through vmcs12, which is dynamically
allocated/freed when nVMX is enabled/disabled. And so if the nested state
is freed with the MMU still pointing at the nested MMU, KVM will hit a NULL
pointer deref when attempting to get L1=>L2 EPTP.
BUG: kernel NULL pointer dereference, address: 0000000000000078
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 114a2d067 P4D 111743067 PUD 11141f067 PMD 0
Oops: Oops: 0000 [#1] SMP
CPU: 20 UID: 1000 PID: 1272 Comm: nested_tdp_faul Not tainted 7.3.0-rc4-8c89f11d1a99b-sink-vm #1914 PREEMPTLAZY
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
RIP: 0010:nested_ept_get_eptp+0xb/0x10 [kvm_intel]
Call Trace:
<TASK>
kvm_mmu_load+0xcd/0x870 [kvm]
kvm_arch_vcpu_ioctl_run+0x18f5/0x1f80 [kvm]
kvm_vcpu_ioctl+0x2c7/0x970 [kvm]
__x64_sys_ioctl+0x90/0xd0
do_syscall_64+0x9c/0x4d0
entry_SYSCALL_64_after_hwframe+0x4b/0x53
RIP: 0033:0x47491b
</TASK>
Modules linked in: kvm_intel kvm irqbypass
CR2: 0000000000000078
---[ end trace 0000000000000000 ]---
RIP: 0010:nested_ept_get_eptp+0xb/0x10 [kvm_intel]
[sean: write changelog]
📍 영향받는 시스템
패치 이전의 Linux 커널(Intel VT-x 기반 nVMX를 사용하는 KVM 호스트 시스템)
⚔️ 공격 벡터
게스트 VM이 중첩 가상화 상태를 조작하여 호스트 커널의 NULL 포인터 역참조를 유발하고 서비스 거부(커널 패닉)를 일으킬 수 있음
🛡️ 대응 방법
해당 커널 수정 사항이 포함된 최신 Linux 커널 배포판으로 업데이트
🔧 검증 코드
출력된 커널 버전을 배포판의 보안 권고와 대조하여 패치 포함 여부를 확인하고, kvm_intel 모듈이 로드되어 있다면 nVMX 기능이 활성화된 환경이므로 우선적으로 업데이트해야 합니다.
uname -r && grep -E 'kvm_intel|nested' /proc/cpuinfo 2>/dev/null | head -1; lsmod | grep kvm_intel