mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:5776a2e9dbmaster date: 2025-09-09 14:11:09 +0200
This commit is contained in:
1 parent
51190865a4
commit
aba830fc0d
1 file changed
+4
@@ -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);
|
||||
|
||||
|
||||