{"id":"CVE-2026-99345","state":"PUBLISHED","title":"KVM: nSVM: Reject KVM_SET_NESTED_STATE if L1 has EFER.LMA=1 && EFER.LME=0","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: nSVM: Reject KVM_SET_NESTED_STATE if L1 has EFER.LMA=1 && EFER.LME=0\n\nReject KVM_SET_NESTED_STATE if the incoming L1 host state has what is\neffectively an impossible EFER combination of LMA=1 but LME=0, i.e. if the\nstate says long mode is active but not enabled.  Unlike VMX, SVM doesn't\nhave an explicit consistent check for the illegal combination; presumably\nhardware simply ignores EFER.LMA if EFER.LME=0.\n\nUnfortunately, KVM doesn't ignore EFER.LMA in this case and consumes the\nillegal state when constructing the shadow MMU for L2.  E.g. if userspace\nalso clears CR4.PAE, then kvm_calc_cpu_role() will compute a role with 4 or\n5 levels of paging, but shadow_mmu_init_context() will wire up the MMU to\nuse the paging32 template, which maxes out its levels at 2.\n\nNote, the \"real badness\" is effectively the same as what happened with the\nnVMX bug fixed by commit 112e66017bff (\"KVM: nVMX: add missing consistency\nchecks for CR0 and CR4\").  Unfortunately, the sanity check added by commit\n72e2fb24a0b0 (\"KVM: x86/mmu: Bug the VM if a vCPU ends up in long mode\nwithout PAE enabled\") doesn't work for this case, since L2 state is active\nat the time of the page fault, but it's L1 that has the bad state.","publishedAt":"2026-11-19T14:21:53.509Z","updatedAt":"2026-11-22T11:07:46.980Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"cc440cdad5b7a4c1de12dace725209eb3e0cf663","status":"affected","lessThan":"c0b29d523ef363d1d7ccfb3199f0126b22a61f66","versionType":"git"},{"version":"cc440cdad5b7a4c1de12dace725209eb3e0cf663","status":"affected","lessThan":"98362865bb626bb5e76cede98555d7cd4fefc016","versionType":"git"},{"version":"cc440cdad5b7a4c1de12dace725209eb3e0cf663","status":"affected","lessThan":"81c460713ca62fa33ee1241fda1ddaf099facb32","versionType":"git"},{"version":"cc440cdad5b7a4c1de12dace725209eb3e0cf663","status":"affected","lessThan":"5dc500a354cc8e109df678076ae3488094649468","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/x86/kvm/svm/nested.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.8","versionType":"semver"},{"version":"6.12.118","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.64","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.2","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/x86/kvm/svm/nested.c"]}],"references":["https://git.kernel.org/stable/c/c0b29d523ef363d1d7ccfb3199f0126b22a61f66","https://git.kernel.org/stable/c/98362865bb626bb5e76cede98555d7cd4fefc016","https://git.kernel.org/stable/c/81c460713ca62fa33ee1241fda1ddaf099facb32","https://git.kernel.org/stable/c/5dc500a354cc8e109df678076ae3488094649468"],"weaknesses":[],"ingestedAt":"2026-11-22T11:18:06.032Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/99xxx/CVE-2026-99345.json","commit":"247cc9beefd85903834df0592e88a44f4d599223","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-99345","state":"PUBLISHED","datePublished":"2026-11-19T14:21:53.509Z","dateUpdated":"2026-11-22T11:07:46.980Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-09-25T10:25:14.409Z"},"containers":{"cna":{"title":"KVM: nSVM: Reject KVM_SET_NESTED_STATE if L1 has EFER.LMA=1 && EFER.LME=0","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: nSVM: Reject KVM_SET_NESTED_STATE if L1 has EFER.LMA=1 && EFER.LME=0\n\nReject KVM_SET_NESTED_STATE if the incoming L1 host state has what is\neffectively an impossible EFER combination of LMA=1 but LME=0, i.e. if the\nstate says long mode is active but not enabled.  Unlike VMX, SVM doesn't\nhave an explicit consistent check for the illegal combination; presumably\nhardware simply ignores EFER.LMA if EFER.LME=0.\n\nUnfortunately, KVM doesn't ignore EFER.LMA in this case and consumes the\nillegal state when constructing the shadow MMU for L2.  E.g. if userspace\nalso clears CR4.PAE, then kvm_calc_cpu_role() will compute a role with 4 or\n5 levels of paging, but shadow_mmu_init_context() will wire up the MMU to\nuse the paging32 template, which maxes out its levels at 2.\n\nNote, the \"real badness\" is effectively the same as what happened with the\nnVMX bug fixed by commit 112e66017bff (\"KVM: nVMX: add missing consistency\nchecks for CR0 and CR4\").  Unfortunately, the sanity check added by commit\n72e2fb24a0b0 (\"KVM: x86/mmu: Bug the VM if a vCPU ends up in long mode\nwithout PAE enabled\") doesn't work for this case, since L2 state is active\nat the time of the page fault, but it's L1 that has the bad state."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"cc440cdad5b7a4c1de12dace725209eb3e0cf663","status":"affected","lessThan":"c0b29d523ef363d1d7ccfb3199f0126b22a61f66","versionType":"git"},{"version":"cc440cdad5b7a4c1de12dace725209eb3e0cf663","status":"affected","lessThan":"98362865bb626bb5e76cede98555d7cd4fefc016","versionType":"git"},{"version":"cc440cdad5b7a4c1de12dace725209eb3e0cf663","status":"affected","lessThan":"81c460713ca62fa33ee1241fda1ddaf099facb32","versionType":"git"},{"version":"cc440cdad5b7a4c1de12dace725209eb3e0cf663","status":"affected","lessThan":"5dc500a354cc8e109df678076ae3488094649468","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/x86/kvm/svm/nested.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.8","versionType":"semver"},{"version":"6.12.118","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.64","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.2","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/x86/kvm/svm/nested.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/c0b29d523ef363d1d7ccfb3199f0126b22a61f66"},{"url":"https://git.kernel.org/stable/c/98362865bb626bb5e76cede98555d7cd4fefc016"},{"url":"https://git.kernel.org/stable/c/81c460713ca62fa33ee1241fda1ddaf099facb32"},{"url":"https://git.kernel.org/stable/c/5dc500a354cc8e109df678076ae3488094649468"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - kvm_arch_vcpu_ioctl's KVM_SET_NESTED_STATE path copies the userspace VMCB save area into vmcb01 in svm_set_nested_state; save->efer with EFER.LMA set and EFER.LME clear is that ioctl buffer. nested_svm_vmrun only stores vcpu->arch.efer, which set_efer and svm_set_cr0 keep consistent.\nAC:L - The caller sets save->efer, clears save->cr4 PAE, sets SVM_MISC_ENABLE_NP, and KVM_RUNs. nested and npt default on. paging32 walk_addr_generic only checks is_long_mode(vcpu)&&!is_pae(vcpu), which reads L2 arch.efer/cr4 from KVM_SET_SREGS, so that check does not stop the walk.\nPR:L - svm_set_nested_state is reached from kvm_vcpu_ioctl with no capable() check. A local user who can open /dev/kvm and create a vCPU can pass the nested state; CAP_SYS_ADMIN is not required.\nUI:N - The attacker opens /dev/kvm and issues KVM_SET_NESTED_STATE and KVM_RUN. No other user has to mount, open, or approve anything.\nS:U - The overflow is in the host paging32 guest_walker while handling an NPT fault for a VM the caller already owns. That is host privilege escalation from the KVM process; L1 VMRUN stores a consistent vcpu->arch.efer and cannot plant this pair.\nC:H - walk_addr_generic writes PTE-derived GFNs and host HVAs at guest_walker indexes 2 and 3 while paging32 arrays are PT_MAX_FULL_LEVELS long (2). update_accessed_dirty_bits and FNAME(fetch) read those slots back, including ptep_user, so the stack corruption discloses adjacent kernel stack data.\nI:H - Those out-of-bounds stores write caller-controlled PTE bytes over the stack object, and FNAME(fetch) passes gw->table_gfn[it.level-2] for shadow levels 4/5 into kvm_mmu_get_child_sp, so the smashed values drive host shadow-page updates.\nA:H - Overrunning guest_walker and then using a smashed ptep_user in __try_cmpxchg_user, or an inconsistent shadow level in FNAME(fetch), oopses the host. That is the same on-stack walker corruption described for the earlier nVMX bug."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-22T11:07:46.980Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"6.12.118"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"6.18.64"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"7.3.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}