From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E1BC392812 for ; Sun, 19 Jul 2026 12:04:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784462688; cv=none; b=jT6gj11uhBYWjpyuFgEgPdl779Oe8vH8Na0s7rXOpoWp4ryKOjPiOrRie0dKWpX0XhxywwlCgSzm1vaY5h5TSmG/9QMc51mKjZ8V1InwuWM8SpQ3yjtnAjL+iWnZgkHRx9i5s/cldp/Ss6RTx3kFqhLyCcY+jTaY1O19F92vz+M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784462688; c=relaxed/simple; bh=K2tb2tRkumMStqCkxYPPC87YoflcccHSTrSfHYzfG9U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Qe8Yqs33vIuGdOIUT1quaH/U0mGxtCtFEZUuugpoRg9sGSWLSbtMRCUjKwNbYrxN0f4yQGtOPXtQuFUzXrQVNzwA1ys9sSn65g2hQIKRuhfVBkBP0TXtq71hO5dfTHm3I8FS2dJfObDT8abrql6N2T697hw//d0ruARg6+1wrCg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wbG0bWb4; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wbG0bWb4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D43F31F000E9; Sun, 19 Jul 2026 12:04:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784462687; bh=WViFQLBQczNBKt+TsZl/8f5/sdzyQVCW4zhJym/y6X8=; h=From:To:Cc:Subject:Date:Reply-To; b=wbG0bWb4omDS3Q82w8YihoQ2ZeRRcmBr73sHXxIolE2MzOMHY0TYst9SkbzjSiM6N Z8yXYGuJxgGJ4/K8yM6I8vSP2cZimPBlztkIGMHyZNskGgxit5b2CvLhml8Rowh3J1 2VbJ1tS/pkiwTIENJKr9U4LwuDpjpspeV9zl4fQs= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-63807: KVM: x86/mmu: Ensure hugepage is in by slot before checking max mapping level Date: Sun, 19 Jul 2026 14:02:24 +0200 Message-ID: <2026071902-CVE-2026-63807-1018@gregkh> X-Mailer: git-send-email 2.55.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5636; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=WasihgwEFs0HaHRZwL0NQbmeYbLQme2eTr11CAvRO6Q=; b=owGbwMvMwCRo6H6F97bub03G02pJDFkxe3bN7vm0KeS32q4gWfmttwwmp+QWFibZ35z7xMg4t rLH+7p8RywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzk+xqGeWqd+/h3ufQsen3q f+UlueYOhif3hRgWXJhRd83oss9Fy+/S6+6x6srPOvGVGwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: KVM: x86/mmu: Ensure hugepage is in by slot before checking max mapping level When recovering hugepages in the shadow MMU, verify that the base gfn of the shadow page is actually contained within the target memslot, *before* querying the max mapping level given the shadow page's gfn. Failure to pre-check the validity of the gfn can lead to an out-of-bounds access to the slot's lpage_info (which typically manifests as a host #PF because the lpage_info is vmalloc'd) if the guest creates a hugepage mapping (in its PTEs) that extends "below" the bounds of a memslot. When faulting in memory for a guest, and the size of the guest mapping is greater than KVM's (current) max mapping, then KVM will create a "direct" shadow page (direct in that there are no gPTEs to shadow, and so the target gfn is a direct calculation given the base gfn of the shadow page). The hugepage recovery flow looks for such direct shadow pages, as forcing 4KiB mappings when dirty logging generates the guest > host mapping size case. When the 4KiB restriction is lifted, then KVM can replace the shadow page with a hugepage. But if KVM originally used a smaller mapping than the guest because the range of memory covered by the guest hugepage exceeds the bounds of a memslot, then KVM will link a direct shadow page with a gfn that is outside the bounds of the memslot being used to fault in memory. The rmap entry added for the leaf mapping is correct and within bounds, but the gfn of the leaf SPTE's parent shadow page will be out of bounds. BUG: unable to handle page fault for address: ffffc90000806ffc #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 100000067 P4D 100000067 PUD 1002a7067 PMD 10612f067 PTE 0 Oops: Oops: 0000 [#1] SMP CPU: 13 UID: 1000 PID: 757 Comm: mmu_stress_test Not tainted 7.1.0-rc1-48ce1e26eace-x86_pir_to_irr_comments-vm #341 PREEMPT Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:kvm_mmu_max_mapping_level+0x79/0x2b0 [kvm] Call Trace: kvm_mmu_recover_huge_pages+0x21b/0x320 [kvm] kvm_set_memslot+0x1ee/0x590 [kvm] kvm_set_memory_region.part.0+0x3a1/0x4d0 [kvm] kvm_vm_ioctl+0x9bf/0x15d0 [kvm] __x64_sys_ioctl+0x8a/0xd0 do_syscall_64+0xb7/0xbb0 entry_SYSCALL_64_after_hwframe+0x4b/0x53 RIP: 0033:0x7f21c0f1a9bf Don't bother pre-checking the bounds of the potential hugepage, i.e. don't check that e.g. sp->gfn + KVM_PAGES_PER_HPAGE(sp->role.level + 1) is also within the memslot, as the checks performed by kvm_mmu_max_mapping_level() are a superset of the basic bounds checks. I.e. pre-checking the full range would be a dubious micro-optimization. The Linux kernel CVE team has assigned CVE-2026-63807 to this issue. Affected and fixed versions =========================== Issue introduced in 5.12 with commit 9eba50f8d7fcb61774f160890f98239fa3ab68a6 and fixed in 5.15.211 with commit 7b52008023b7facf40fba3ebe92449bda8ea53b9 Issue introduced in 5.12 with commit 9eba50f8d7fcb61774f160890f98239fa3ab68a6 and fixed in 6.1.177 with commit 5cab1c989f938f5e1b9a0de66486f1fc2c28479b Issue introduced in 5.12 with commit 9eba50f8d7fcb61774f160890f98239fa3ab68a6 and fixed in 6.6.144 with commit 48b91ed7e22bb82571c34f8b80b6ecdc90a6fab8 Issue introduced in 5.12 with commit 9eba50f8d7fcb61774f160890f98239fa3ab68a6 and fixed in 6.12.95 with commit c5c29b3c268332afe67d598a034c58344540ed92 Issue introduced in 5.12 with commit 9eba50f8d7fcb61774f160890f98239fa3ab68a6 and fixed in 6.18.38 with commit 18587f9831612e24cd8f24be1ec15478feff7abc Issue introduced in 5.12 with commit 9eba50f8d7fcb61774f160890f98239fa3ab68a6 and fixed in 7.1.3 with commit b2ae3245ea44dccaa9af676b6747476951883318 Issue introduced in 5.12 with commit 9eba50f8d7fcb61774f160890f98239fa3ab68a6 and fixed in 7.2-rc1 with commit ef057cbf825e03b63f6edf5980f96abf3c53089d Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-63807 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: arch/x86/kvm/mmu/mmu.c include/linux/kvm_host.h Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/7b52008023b7facf40fba3ebe92449bda8ea53b9 https://git.kernel.org/stable/c/5cab1c989f938f5e1b9a0de66486f1fc2c28479b https://git.kernel.org/stable/c/48b91ed7e22bb82571c34f8b80b6ecdc90a6fab8 https://git.kernel.org/stable/c/c5c29b3c268332afe67d598a034c58344540ed92 https://git.kernel.org/stable/c/18587f9831612e24cd8f24be1ec15478feff7abc https://git.kernel.org/stable/c/b2ae3245ea44dccaa9af676b6747476951883318 https://git.kernel.org/stable/c/ef057cbf825e03b63f6edf5980f96abf3c53089d