xen/arm: create_p2m_entries should not call free_domheap_page

The guest is entitled to leak a page from its p2m (by overwriting it) if
it wants to. Since the memory is effectively lost to it (can't even be
recovered by XENMEM increase reservation etc).

In these cases we shouldn't call free_domheap_page to free the existing
page from create_p2m_entries, because it resets the reference counting
but the page is still allocated to the guest (even if not in the p2m
anymore) and common grant_table code is also going to call put_page on
it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Stefano Stabellini committed 2012-10-09 15:05:34 +01:00
1 parent 48d56ac850
commit a3d1dbc607
1 file changed
-5
-5
View File
@@ -189,12 +189,7 @@ static int create_p2m_entries(struct domain *d,
/* else: third already valid */
if ( third[third_table_offset(addr)].p2m.valid )
{
/* p2m entry already present */
free_domheap_page(
mfn_to_page(third[third_table_offset(addr)].p2m.base));
flush_tlb_all_local();
}
/* Allocate a new RAM page and attach */
switch (op) {
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.