🔍 CVE-2025-40038

7.1
CVSS Score
HIGH
2025-10-28
2026-10-19 21:10
✅ 완료

🇰🇷 한글 설명

Linux 커널의 KVM(Kernel-based Virtual Machine) SVM 핸들러에서 다음 RIP(Instruction Pointer)가 유효하지 않을 때 fastpath 에뮬레이션을 건너뛰지 않아 발생하는 취약점입니다. 이로 인해 인터럽트가 비활성화된 상태에서 게스트 메모리를 읽으려다 sleep(대기) 상태에 빠지는 커널 패닉이 발생할 수 있습니다.

💡 쉬운 설명

가상 머신을 운영하는 시스템의 핵심 엔진에서 잘못된 명령을 처리하려다 컴퓨터 전체가 멈추거나 오류가 발생하는 문제입니다. 특히 특정 설정에서 시스템이 예상치 못한 방식으로 동작하며 충돌을 일으킬 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: KVM: SVM: Skip fastpath emulation on VM-Exit if next RIP isn't valid Skip the WRMSR and HLT fastpaths in SVM's VM-Exit handler if the next RIP isn't valid, e.g. because KVM is running with nrips=false. SVM must decode and emulate to skip the instruction if the CPU doesn't provide the next RIP, and getting the instruction bytes to decode requires reading guest memory. Reading guest memory through the emulator can fault, i.e. can sleep, which is disallowed since the fastpath handlers run with IRQs disabled. BUG: sleeping function called from invalid context at ./include/linux/uaccess.h:106 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 32611, name: qemu preempt_count: 1, expected: 0 INFO: lockdep is turned off. irq event stamp: 30580 hardirqs last enabled at (30579): [<ffffffffc08b2527>] vcpu_run+0x1787/0x1db0 [kvm] hardirqs last disabled at (30580): [<ffffffffb4f62e32>] __schedule+0x1e2/0xed0 softirqs last enabled at (30570): [<ffffffffb4247a64>] fpu_swap_kvm_fpstate+0x44/0x210 softirqs last disabled at (30568): [<ffffffffb4247a64>] fpu_swap_kvm_fpstate+0x44/0x210 CPU: 298 UID: 0 PID: 32611 Comm: qemu Tainted: G U 6.16.0-smp--e6c618b51cfe-sleep #782 NONE Tainted: [U]=USER Hardware name: Google Astoria-Turin/astoria, BIOS 0.20241223.2-0 01/17/2025 Call Trace: <TASK> dump_stack_lvl+0x7d/0xb0 __might_resched+0x271/0x290 __might_fault+0x28/0x80 kvm_vcpu_read_guest_page+0x8d/0xc0 [kvm] kvm_fetch_guest_virt+0x92/0xc0 [kvm] __do_insn_fetch_bytes+0xf3/0x1e0 [kvm] x86_decode_insn+0xd1/0x1010 [kvm] x86_emulate_instruction+0x105/0x810 [kvm] __svm_skip_emulated_instruction+0xc4/0x140 [kvm_amd] handle_fastpath_invd+0xc4/0x1a0 [kvm] vcpu_run+0x11a1/0x1db0 [kvm] kvm_arch_vcpu_ioctl_run+0x5cc/0x730 [kvm] kvm_vcpu_ioctl+0x578/0x6a0 [kvm] __se_sys_ioctl+0x6d/0xb0 do_syscall_64+0x8a/0x2c0 entry_SYSCALL_64_after_hwframe+0x4b/0x53 RIP: 0033:0x7f479d57a94b </TASK> Note, this is essentially a reapply of commit 5c30e8101e8d ("KVM: SVM: Skip WRMSR fastpath on VM-Exit if next RIP isn't valid"), but with different justification (KVM now grabs SRCU when skipping the instruction for other reasons).

📍 영향받는 시스템

Linux Kernel (KVM/SVM 모듈 사용 환경)

⚔️ 공격 벡터

악의적인 게스트 OS가 유효하지 않은 RIP 상태를 유도하여 호스트 커널의 sleep 호출을 유발함으로써 DoS(서비스 거부) 공격 수행

🛡️ 대응 방법

KVM SVM fastpath 관련 패치가 적용된 최신 Linux 커널로 업데이트

🔧 검증 코드

출력된 커널 버전이 취약점이 해결된 최신 패치 버전인지 확인합니다.

Shell / Script
uname -r

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H

💻 영향받는 소프트웨어

Linux Kernel