Arm: foreign page handling in p2m_get_page_from_gfn()

I can't see what would make the 1st of the assertions safe: For example,
the P2M lock not being held, the foreign page may disappear before we
get to call page_get_owner_and_reference(), which hence may return NULL.

Even the 2nd, which appears to be safe safe, is lacking proper release
build fallbacks.

Drop the former in favor of an if(), and convert the latter to the
equivalent of what x86 uses: ASSERT_UNREACHABLE() plus putting of the
obtained page.

This is CVE-2025-58144 / part of XSA-473.

Fixes: 9486a8d07b ("xen/arm: Handle remove foreign mapping")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
master commit: c5a6dd6850
master date: 2025-09-09 14:12:13 +0200
This commit is contained in:
Jan Beulich committed 2025-09-09 14:27:50 +02:00
1 parent af733b706d
commit 0b39ff2964
1 file changed
+10 -4
+10 -4
View File
@@ -618,10 +618,16 @@ struct page_info *p2m_get_page_from_gfn(struct domain *d, gfn_t gfn,
*/
if ( p2m_is_foreign(p2mt) )
{
struct domain *fdom = page_get_owner_and_reference(page);
ASSERT(fdom != NULL);
ASSERT(fdom != d);
return page;
const struct domain *fdom = page_get_owner_and_reference(page);
if ( fdom )
{
if ( fdom != d )
return page;
ASSERT_UNREACHABLE();
put_page(page);
}
return NULL;
}
return get_page(page, d) ? page : NULL;
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.