x86/viridian: avoid NULL pointer dereference in update_reference_tsc()

The function is only called when the MSR has the enabled bit set, but even
then the page might not be mapped because the guest provided gfn is not
suitable.

Prevent a NULL pointer dereference in update_reference_tsc() by checking
whether the page is mapped.

This is CVE-2025-27466 / part of XSA-472.

Fixes: 386b336522 ('viridian: use viridian_map/unmap_guest_page() for reference tsc page')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 5776a2e9db
master date: 2025-09-09 14:11:09 +0200
This commit is contained in:
Roger Pau Monné authored and Jan Beulich committed 2025-09-09 14:25:01 +02:00
1 parent 51190865a4
commit aba830fc0d
1 file changed
+4
+4
View File
@@ -26,6 +26,10 @@ static void update_reference_tsc(const struct domain *d, bool initialize)
HV_REFERENCE_TSC_PAGE *p = rt->ptr;
uint32_t seq;
/* Reference TSC page might not be mapped even if the MSR is enabled. */
if ( !p )
return;
if ( initialize )
clear_page(p);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.