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 55F9F24678C for ; Sat, 16 Aug 2025 10:58:46 +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=1755341927; cv=none; b=Bf/qor9xV14zxbpFLh5yGrVuZ3cx1mXOJIMJTfznlbgrODpZrbXIqPF7iM3jdT4/HMryQGqPuXJF01ssx/i612RKune182ZbM9EuDGt2SEBSOcKloIW0A8dTxGU8tVMTzzLE1hPd6VwYONY+hGk+a1Msef77SW4+EVO8ftfW31w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755341927; c=relaxed/simple; bh=19YvAexpapCzb5PFjQeoyIAA+kBsjS36dJ1hSB4H0fE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=one0wxJ9oOLi5HJQEOh69KQrsxJUfvKmDdeE5GFd3HWDZpZuBwGuaiE84C4yDOY7rGrELlYdd8MNWZatBjfP3M5HYobtcXdTBHgEoSEtLXt+JWwB30DHIrqzjK9TQOUt/M9NJ6NcEKpmpizviEUz7dMsl4roJXIYncN9+7ijFh8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rjP+u8sV; 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="rjP+u8sV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CE15C4CEEF; Sat, 16 Aug 2025 10:58:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755341926; bh=19YvAexpapCzb5PFjQeoyIAA+kBsjS36dJ1hSB4H0fE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=rjP+u8sVG3RnesPjeBAWhRncolKBiJ+WGpjPYDkS76+FkRMAPlF/inxr5r4QGHGxN NwUpKY2xJp/VcM3zwzq/D9rxHDq9wS7pWfXoHxBihKMqIlaZtVjJpLKS0mTYVLaAJF eYBjSS6LepSfZt8Z9NR9/URUG3hPs5aQR5Bon/XU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38508: x86/sev: Use TSC_FACTOR for Secure TSC frequency calculation Date: Sat, 16 Aug 2025 12:57:50 +0200 Message-ID: <2025081650-CVE-2025-38508-18ae@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=3003; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=cCklABm9fFq3sw4sxH7U0QgyQ0Do6zmyRaI9SuUK1F0=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkLUvRCildve+G+W2KP2d0iq0nfAreabN+zfPox3z+s2 wSznlu5d8SyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEpL4zLNjy5GbQ+vv5e1d2 Xapcfe76aqbFrE0MC7q10oKS0pIn3VXIWRe9KCz+9lKJpwA= 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: x86/sev: Use TSC_FACTOR for Secure TSC frequency calculation When using Secure TSC, the GUEST_TSC_FREQ MSR reports a frequency based on the nominal P0 frequency, which deviates slightly (typically ~0.2%) from the actual mean TSC frequency due to clocking parameters. Over extended VM uptime, this discrepancy accumulates, causing clock skew between the hypervisor and a SEV-SNP VM, leading to early timer interrupts as perceived by the guest. The guest kernel relies on the reported nominal frequency for TSC-based timekeeping, while the actual frequency set during SNP_LAUNCH_START may differ. This mismatch results in inaccurate time calculations, causing the guest to perceive hrtimers as firing earlier than expected. Utilize the TSC_FACTOR from the SEV firmware's secrets page (see "Secrets Page Format" in the SNP Firmware ABI Specification) to calculate the mean TSC frequency, ensuring accurate timekeeping and mitigating clock skew in SEV-SNP VMs. Use early_ioremap_encrypted() to map the secrets page as ioremap_encrypted() uses kmalloc() which is not available during early TSC initialization and causes a panic. [ bp: Drop the silly dummy var: https://lore.kernel.org/r/20250630192726.GBaGLlHl84xIopx4Pt@fat_crate.local ] The Linux kernel CVE team has assigned CVE-2025-38508 to this issue. Affected and fixed versions =========================== Issue introduced in 6.14 with commit 73bbf3b0fbba9aa27fef07a1fbd837661a863f03 and fixed in 6.15.7 with commit d0195c42e65805938c9eb507657e7cdf8e1e9522 Issue introduced in 6.14 with commit 73bbf3b0fbba9aa27fef07a1fbd837661a863f03 and fixed in 6.16 with commit 52e1a03e6cf61ae165f59f41c44394a653a0a788 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-38508 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/coco/sev/core.c arch/x86/include/asm/sev.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/d0195c42e65805938c9eb507657e7cdf8e1e9522 https://git.kernel.org/stable/c/52e1a03e6cf61ae165f59f41c44394a653a0a788