In the Linux kernel, the following vulnerability has been resolved:
ptp: kvm: x86: Leak clock_pair page if changing its encryption fails
In a confidential guest, kvm_arch_ptp_init() shares the clock_pair page
with the host using set_memory_decrypted(), and kvm_arch_ptp_exit()
makes it private again with set_memory_encrypted() before freeing it.
The untrusted host can make either call fail and leave the page shared.
Both paths still free the page: the init error path with __free_page(),
and kvm_arch_ptp_exit() after only a WARN_ON(). The page allocator can
then hand a page the host can still access to an unrelated user.
Leak the page in both cases instead, as was done for the same situation
in commit b9fa16949d18 ("dma-direct: Leak pages on dma_set_decrypted()
failure") and commit 03f5a999adba ("Drivers: hv: vmbus: Leak pages if
set_memory_encrypted() fails").
CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
CVSS Score: 9.3
AV:L - The attacker is the KVM host of a confidential guest. ptp_kvm_init() calls kvm_arch_ptp_init(), which shares one clock_pair page via set_memory_decrypted(); the host then forces kvm_arch_ptp_exit() because pvclock_get_pvti_cpu0_va() is NULL or KVM_HC_CLOCK_PAIRING returns -KVM_ENOSYS. No network protocol carries this fault.
AC:L - The host sets the KVM CPUID signature but omits KVM_FEATURE_CLOCKSOURCE, so kvmclock_init() never calls pvclock_set_pvti_cpu0_va(), and then returns a failing TDVMCALL status from tdx_map_gpa() so tdx_enc_status_change_prepare() makes set_memory_encrypted() fail while clock_pair is still shared. Both steps are host-controlled and repeatable.
PR:N - ptp_kvm_init() is a device_initcall with no credential or capability check (CONFIG_PTP_1588_CLOCK_KVM defaults to y). The host is outside the guest and needs no account inside it; it only answers CPUID, the KVM hypercall, and MapGPA.
UI:N - With the driver built in, ptp_kvm_init() runs at boot and takes the kvm_arch_ptp_exit() error path solely because of host CPUID and MapGPA results. No guest user has to load a module, mount media, or open a file.
S:C - Pre-fix kvm_arch_ptp_exit() free_page()s the clock_pair page after set_memory_encrypted() fails, returning a still-shared page to the buddy allocator and exposing later memory of every other guest authority across the TDX/SEV hardware boundary, as with an IOMMU bypass.
C:H - tdx_enc_status_change_prepare() fails before __change_page_attr_set_clr(), so the direct map stays decrypted. The buddy allocator then places arbitrary later objects (slab, page cache, keys) on that page, which the host reads in plaintext.
I:H - The recycled clock_pair page remains host-writable, so the host can modify whatever live kernel object the allocator puts there, including credentials or structures that hold function pointers.
A:H - A private PTE for that still-shared PFN hits the TDX case in tdx_early_init() where a private mapping of a shared page shuts the guest down, and a host write into the recycled kernel object can oops the guest.
| Attack Vector |
Local |
Scope |
Changed |
| Attack Complexity |
Low |
Confidentiality Impact |
High |
| Privileges Required |
None |
Integrity Impact |
High |
| User Interaction |
None |
Availability Impact |
High |
AV:L - The attacker is the KVM host of a confidential guest. ptp_kvm_init() calls kvm_arch_ptp_init(), which shares one clock_pair page via set_memory_decrypted(); the host then forces kvm_arch_ptp_exit() because pvclock_get_pvti_cpu0_va() is NULL or KVM_HC_CLOCK_PAIRING returns -KVM_ENOSYS. No network protocol carries this fault.
AC:L - The host sets the KVM CPUID signature but omits KVM_FEATURE_CLOCKSOURCE, so kvmclock_init() never calls pvclock_set_pvti_cpu0_va(), and then returns a failing TDVMCALL status from tdx_map_gpa() so tdx_enc_status_change_prepare() makes set_memory_encrypted() fail while clock_pair is still shared. Both steps are host-controlled and repeatable.
PR:N - ptp_kvm_init() is a device_initcall with no credential or capability check (CONFIG_PTP_1588_CLOCK_KVM defaults to y). The host is outside the guest and needs no account inside it; it only answers CPUID, the KVM hypercall, and MapGPA.
UI:N - With the driver built in, ptp_kvm_init() runs at boot and takes the kvm_arch_ptp_exit() error path solely because of host CPUID and MapGPA results. No guest user has to load a module, mount media, or open a file.
S:C - Pre-fix kvm_arch_ptp_exit() free_page()s the clock_pair page after set_memory_encrypted() fails, returning a still-shared page to the buddy allocator and exposing later memory of every other guest authority across the TDX/SEV hardware boundary, as with an IOMMU bypass.
C:H - tdx_enc_status_change_prepare() fails before __change_page_attr_set_clr(), so the direct map stays decrypted. The buddy allocator then places arbitrary later objects (slab, page cache, keys) on that page, which the host reads in plaintext.
I:H - The recycled clock_pair page remains host-writable, so the host can modify whatever live kernel object the allocator puts there, including credentials or structures that hold function pointers.
A:H - A private PTE for that still-shared PFN hits the TDX case in tdx_early_init() where a private mapping of a shared page shuts the guest down, and a host write into the recycled kernel object can oops the guest.
CVSS 3.1