🇰🇷 한글 설명
Linux 커널의 KVM arm64 환경에서 비보호 pKVM 게스트의 ID 레지스터 초기화 오류가 발견되었습니다. 호스트의 상태를 복사하는 과정에서 레지스터 데이터 없이 초기화 플래그만 설정되어, 특정 시스템 레지스터가 제대로 저장되거나 복구되지 않아 상태 오염이 발생할 수 있습니다.
💡 쉬운 설명
가상 머신을 실행할 때 컴퓨터의 중요한 설정값(레지스터)이 제대로 전달되지 않는 버그가 있습니다. 이로 인해 가상 머신이 작동하는 중에 데이터가 꼬이거나 시스템 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
KVM: arm64: Fix ID register initialization for non-protected pKVM guests
In protected mode, the hypervisor maintains a separate instance of
the `kvm` structure for each VM. For non-protected VMs, this structure is
initialized from the host's `kvm` state.
Currently, `pkvm_init_features_from_host()` copies the
`KVM_ARCH_FLAG_ID_REGS_INITIALIZED` flag from the host without the
underlying `id_regs` data being initialized. This results in the
hypervisor seeing the flag as set while the ID registers remain zeroed.
Consequently, `kvm_has_feat()` checks at EL2 fail (return 0) for
non-protected VMs. This breaks logic that relies on feature detection,
such as `ctxt_has_tcrx()` for TCR2_EL1 support. As a result, certain
system registers (e.g., TCR2_EL1, PIR_EL1, POR_EL1) are not
saved/restored during the world switch, which could lead to state
corruption.
Fix this by explicitly copying the ID registers from the host `kvm` to
the hypervisor `kvm` for non-protected VMs during initialization, since
we trust the host with its non-protected guests' features. Also ensure
`KVM_ARCH_FLAG_ID_REGS_INITIALIZED` is cleared initially in
`pkvm_init_features_from_host` so that `vm_copy_id_regs` can properly
initialize them and set the flag once done.
📍 영향받는 시스템
Linux kernel (arm64 architecture, KVM/pKVM 사용 환경)
⚔️ 공격 벡터
로컬 공격자가 특정 시스템 레지스터 상태를 조작하여 가상 머신의 상태 오염을 유도할 수 있음
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 ID 레지스터 초기화 로직을 수정해야 함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인하십시오.