🇰🇷 한글 설명
Linux 커널 KVM의 AMD SEV 코드에서, 이미 시작(launch)되어 암호화된 vCPU의 VMSA에 vCPU 상태를 동기화하려는 시도를 거부하지 않는 결함이 수정되었습니다. SNP가 활성화된 호스트에서는 게스트 전용 메모리에 접근할 때 RMP #PF가 발생해 호스트 커널 패닉을 일으킬 수 있습니다. 이 결함은 SEV-ES 지원 도입(commit ad73109ae7ec) 이후 존재했으나, SNP 지원 추가 이후에야 호스트에 실질적으로 위험해졌습니다.
💡 쉬운 설명
가상 머신(게스트)이 이미 암호화되어 실행 준비가 끝난 상태에서도 특정 설정 변경이 허용되어, 보호된 메모리에 잘못 접근하면서 호스트 서버가 멈출 수 있습니다. 주로 AMD SEV-SNP를 사용하는 가상화 서버에 영향을 미칩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
KVM: SEV: Reject attempts to sync VMSA of an already-launched/encrypted vCPU
Reject synchronizing vCPU state to its associated VMSA if the vCPU has
already been launched, i.e. if the VMSA has already been encrypted. On a
host with SNP enabled, accessing guest-private memory generates an RMP #PF
and panics the host.
BUG: unable to handle page fault for address: ff1276cbfdf36000
#PF: supervisor write access in kernel mode
#PF: error_code(0x80000003) - RMP violation
PGD 5a31801067 P4D 5a31802067 PUD 40ccfb5063 PMD 40e5954063 PTE 80000040fdf36163
SEV-SNP: PFN 0x40fdf36, RMP entry: [0x6010fffffffff001 - 0x000000000000001f]
Oops: Oops: 0003 [#1] SMP NOPTI
CPU: 33 UID: 0 PID: 996180 Comm: qemu-system-x86 Tainted: G OE
Tainted: [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
Hardware name: Dell Inc. PowerEdge R7625/0H1TJT, BIOS 1.5.8 07/21/2023
RIP: 0010:sev_es_sync_vmsa+0x54/0x4c0 [kvm_amd]
Call Trace:
<TASK>
snp_launch_update_vmsa+0x19d/0x290 [kvm_amd]
snp_launch_finish+0xb6/0x380 [kvm_amd]
sev_mem_enc_ioctl+0x14e/0x720 [kvm_amd]
kvm_arch_vm_ioctl+0x837/0xcf0 [kvm]
kvm_vm_ioctl+0x3fd/0xcc0 [kvm]
__x64_sys_ioctl+0xa3/0x100
x64_sys_call+0xfe0/0x2350
do_syscall_64+0x81/0x10f0
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7ffff673287d
</TASK>
Note, the KVM flaw has been present since commit ad73109ae7ec ("KVM: SVM:
Provide support to launch and run an SEV-ES guest"), but has only been
actively dangerous for the host since SNP support was added. With SEV-ES,
KVM would "just" clobber guest state, which is totally fine from a host
kernel perspective since userspace can clobber guest state any time before
sev_launch_update_vmsa().
📍 영향받는 시스템
SNP가 활성화된 AMD EPYC 서버에서 동작하는 Linux 커널의 KVM(kvm_amd) 모듈 (수정 커밋 이전 버전 전반)
⚔️ 공격 벡터
권한이 있는 로컬 사용자 또는 게스트 VM 관리 프로세스가 이미 시작된 SEV-SNP 게스트에 대해 VMSA 동기화 ioctl을 호출하여 호스트 커널 패닉(서비스 거부)을 유발
🛡️ 대응 방법
사용 중인 배포판의 최신 커널 업데이트를 적용하고 재부팅하거나, 패치된 커널 버전(벤더 권고 참조)으로 업그레이드
🔧 검증 코드
출력된 커널 버전을 배포판 보안 권고(예: Ubuntu/RHEL CVE 페이지)의 수정 버전과 비교하여, 해당 CVE 수정이 포함된 커널인지 확인하고 SNP 사용 여부는 dmesg | grep -i sev 로 추가 확인