🇰🇷 한글 설명
Linux 커널의 KVM x86 구현에서 보호된 게스트(SEV-ES, SEV-SNP)의 하이퍼콜 완료 처리 시 발생하는 문제를 수정했습니다. 기존 코드는 vCPU 상태로 64비트 모드를 판단했으나, 보호된 게스트에서는 해당 상태를 읽을 수 없어 경고(WARN)가 발생할 수 있었습니다. 이제 is_64_bit_hypercall()을 사용해 하이퍼콜이 64비트로 이루어졌다고 가정하도록 변경되었습니다.
💡 쉬운 설명
가상 머신 중 보안 기능이 켜진 특수한 가상 머신에서 커널이 잘못된 상태 확인을 하다가 경고를 띄우는 문제를 고쳤습니다. 이 문제는 시스템 정지보다는 불필요한 경고와 안정성 저하에 가깝습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
KVM: x86: Play nice with protected guests in complete_hypercall_exit()
Use is_64_bit_hypercall() instead of is_64_bit_mode() to detect a 64-bit
hypercall when completing said hypercall. For guests with protected state,
e.g. SEV-ES and SEV-SNP, KVM must assume the hypercall was made in 64-bit
mode as the vCPU state needed to detect 64-bit mode is unavailable.
Hacking the sev_smoke_test selftest to generate a KVM_HC_MAP_GPA_RANGE
hypercall via VMGEXIT trips the WARN:
------------[ cut here ]------------
WARNING: CPU: 273 PID: 326626 at arch/x86/kvm/x86.h:180 complete_hypercall_exit+0x44/0xe0 [kvm]
Modules linked in: kvm_amd kvm ... [last unloaded: kvm]
CPU: 273 UID: 0 PID: 326626 Comm: sev_smoke_test Not tainted 6.12.0-smp--392e932fa0f3-feat #470
Hardware name: Google Astoria/astoria, BIOS 0.20240617.0-0 06/17/2024
RIP: 0010:complete_hypercall_exit+0x44/0xe0 [kvm]
Call Trace:
<TASK>
kvm_arch_vcpu_ioctl_run+0x2400/0x2720 [kvm]
kvm_vcpu_ioctl+0x54f/0x630 [kvm]
__se_sys_ioctl+0x6b/0xc0
do_syscall_64+0x83/0x160
entry_SYSCALL_64_after_hwframe+0x76/0x7e
</TASK>
---[ end trace 0000000000000000 ]---
📍 영향받는 시스템
KVM 기능을 사용하는 Linux 커널(수정 커밋 이전 버전), 특히 AMD SEV-ES/SEV-SNP 보호 게스트를 실행하는 호스트
⚔️ 공격 벡터
보호된 게스트가 VMGEXIT를 통해 하이퍼콜을 발생시키면 호스트 커널에서 경고가 출력되는 형태로, 주로 서비스 안정성에 영향을 줄 수 있습니다.
🛡️ 대응 방법
커널을 CVE-2024-55881 수정이 포함된 최신 안정 버전(배포판 보안 업데이트)으로 업그레이드하세요.
🔧 검증 코드
출력된 커널 버전이 배포판의 수정된 보안 업데이트 버전 이상이면 패치가 적용된 것이며, changelog에 해당 문구가 보이면 수정이 포함된 것입니다. 아무 출력이 없으면 배포판 보안 공지에서 해당 커널 버전을 직접 확인하세요.
uname -r && (grep -i 'KVM: x86: Play nice with protected guests' /usr/share/doc/linux-image-$(uname -r)/changelog* 2>/dev/null || rpm -q --changelog kernel 2>/dev/null | grep -i 'protected guests' | head -n 1)