Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 ED2B4148838 for ; Sat, 19 Jul 2025 11:59:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752926398; cv=none; b=VKn9jo+dAkq61iu/8HHu2fWbFp58C6XxkDWhTFR4sR7HiaZOdQpuOFGW8kqzSNMtxotItiepChFGooUXtb4qVmbzVY+7MwDG4+4DHRi48fwEuX73ZQgN/bV+yqS8Pur5CswGffa8rP8bX9GvnWhdiPFh6906Arih4tzhUjVb8Jc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752926398; c=relaxed/simple; bh=w2VWeOFd3rOVravlnxlFui2j8UEc9E0Rq20NorxPQms=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=EhR3SP5zhEsrxs99A6ptrHtlvRzIMcMsMLne7VjZlj2I95Db4hUi4bL8CdktbrsPkuGP3Pq/p+iDVblBkDrlMCZr9yhrF7D306SpMJZzF2Xz5NwgXqVCr19NXtKgj2929sAYZcpGG5CdxEdZEjqr5klj5rPRvUOmGtD6HBv6LwY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LAK7R806; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="LAK7R806" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAB68C4CEE3; Sat, 19 Jul 2025 11:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1752926397; bh=w2VWeOFd3rOVravlnxlFui2j8UEc9E0Rq20NorxPQms=; h=From:To:Cc:Subject:Date:Reply-to:From; b=LAK7R8065ab+vqVdKmmFRR17G0cPAsItqwNSgAemSMjIvTyLCTgO1q1+lbWbkTTTZ fuqpjflnSzRBG74Y9ais4TIKoZwonnZ3MTmWVxcOQwKB1ptdEHXSkI6/MFzxzwWMtd IPlbaPEvZN55Z+i7fk3osZAx5J3t3R06t3SKlH/M= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38351: KVM: x86/hyper-v: Skip non-canonical addresses during PV TLB flush Date: Sat, 19 Jul 2025 13:59:52 +0200 Message-ID: <2025071951-CVE-2025-38351-75ea@gregkh> X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3690; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=PsBQbWbD8GNUl2TOWF3pBUIu5eJJoDf+i2d3bxmrZPQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnVHdsnWLy8oNvnEuurOdGF7cD5ovUapVPubl5ce0D5k NCBWQaWHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRCfIMC9Zd+Pf6V+U3fm9t 1pfM082eLzK7zMIwT/HiX7n+vfwMOUYqP/RDJnxTa8q6AwA= 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/hyper-v: Skip non-canonical addresses during PV TLB flush In KVM guests with Hyper-V hypercalls enabled, the hypercalls HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST and HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX allow a guest to request invalidation of portions of a virtual TLB. For this, the hypercall parameter includes a list of GVAs that are supposed to be invalidated. However, when non-canonical GVAs are passed, there is currently no filtering in place and they are eventually passed to checked invocations of INVVPID on Intel / INVLPGA on AMD. While AMD's INVLPGA silently ignores non-canonical addresses (effectively a no-op), Intel's INVVPID explicitly signals VM-Fail and ultimately triggers the WARN_ONCE in invvpid_error(): invvpid failed: ext=0x0 vpid=1 gva=0xaaaaaaaaaaaaa000 WARNING: CPU: 6 PID: 326 at arch/x86/kvm/vmx/vmx.c:482 invvpid_error+0x91/0xa0 [kvm_intel] Modules linked in: kvm_intel kvm 9pnet_virtio irqbypass fuse CPU: 6 UID: 0 PID: 326 Comm: kvm-vm Not tainted 6.15.0 #14 PREEMPT(voluntary) RIP: 0010:invvpid_error+0x91/0xa0 [kvm_intel] Call Trace: vmx_flush_tlb_gva+0x320/0x490 [kvm_intel] kvm_hv_vcpu_flush_tlb+0x24f/0x4f0 [kvm] kvm_arch_vcpu_ioctl_run+0x3013/0x5810 [kvm] Hyper-V documents that invalid GVAs (those that are beyond a partition's GVA space) are to be ignored. While not completely clear whether this ruling also applies to non-canonical GVAs, it is likely fine to make that assumption, and manual testing on Azure confirms "real" Hyper-V interprets the specification in the same way. Skip non-canonical GVAs when processing the list of address to avoid tripping the INVVPID failure. Alternatively, KVM could filter out "bad" GVAs before inserting into the FIFO, but practically speaking the only downside of pushing validation to the final processing is that doing so is suboptimal for the guest, and no well-behaved guest will request TLB flushes for non-canonical addresses. The Linux kernel CVE team has assigned CVE-2025-38351 to this issue. Affected and fixed versions =========================== Issue introduced in 6.2 with commit 260970862c88b4130e9e12be023c7e2c2d37a966 and fixed in 6.15.7 with commit 2d4dea3f76510c0afe3f18c910f647b816f7d566 Issue introduced in 6.2 with commit 260970862c88b4130e9e12be023c7e2c2d37a966 and fixed in 6.16-rc6 with commit fa787ac07b3ceb56dd88a62d1866038498e96230 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-2025-38351 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/hyperv.c 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/2d4dea3f76510c0afe3f18c910f647b816f7d566 https://git.kernel.org/stable/c/fa787ac07b3ceb56dd88a62d1866038498e96230