x86/pod: do not reclaim special pages for PoD cache

When doing PoD cache reclaim as part of a decrease reservation call, avoid
reclaiming special pages for the PoD cache.  Otherwise such pages get moved
from the domain ->xenpage_list to the ->page_list, while still being
referenced in ->shared_info domain field.

Prevent PoD cache from reclaiming special pages, as nothing good can come
out of it.

This is XSA-507 / CVE-2026-62434.

Fixes: 41aa0b6269 ("PoD memory 4/9: Decrease reservation")
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Roger Pau Monne authored and Andrew Cooper committed 2026-07-28 12:40:10 +01:00
1 parent aef948a300
commit 372497ce42
1 file changed
+6 -2
+6 -2
View File
@@ -536,12 +536,13 @@ decrease_reservation(struct domain *d, gfn_t gfn, unsigned int order)
p2m_access_t a; p2m_access_t a;
p2m_type_t t; p2m_type_t t;
unsigned int cur_order; unsigned int cur_order;
mfn_t mfn = p2m->get_entry(p2m, gfn_add(gfn, i), &t, &a, 0, &cur_order,
NULL);
p2m->get_entry(p2m, gfn_add(gfn, i), &t, &a, 0, &cur_order, NULL);
n = 1UL << min(order, cur_order); n = 1UL << min(order, cur_order);
if ( p2m_is_pod(t) ) if ( p2m_is_pod(t) )
pod += n; pod += n;
else if ( p2m_is_ram(t) ) else if ( p2m_is_ram(t) && !is_special_page(mfn_to_page(mfn)) )
ram += n; ram += n;
} }
@@ -644,6 +645,9 @@ decrease_reservation(struct domain *d, gfn_t gfn, unsigned int order)
ASSERT(mfn_valid(mfn)); ASSERT(mfn_valid(mfn));
page = mfn_to_page(mfn); page = mfn_to_page(mfn);
if ( is_special_page(page) )
/* Do not touch special pages, let generic code handle them. */
continue;
/* This shouldn't be able to fail */ /* This shouldn't be able to fail */
if ( p2m_set_entry(p2m, gfn_add(gfn, i), INVALID_MFN, cur_order, if ( p2m_set_entry(p2m, gfn_add(gfn, i), INVALID_MFN, cur_order,
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.