memory: don't implicitly unpin for decrease-reservation
authorJan Beulich <jbeulich@suse.com>
Fri, 2 Mar 2018 15:39:41 +0000 (15:39 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 2 Mar 2018 16:07:18 +0000 (16:07 +0000)
It very likely was a mistake (copy-and-paste from domain cleanup code)
to implicitly unpin here: The caller should really unpin itself before
(or after, if they so wish) requesting the page to be removed.

This is XSA-252.

Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Gbp-Pq: Name memory-dont-implicitly-unpin-for-decreas.patch

xen/common/memory.c

index 1770f24d10abff0702fbb1d987c0880162813537..cda79185b9d5ecf62a67c76177923f396e82fb08 100644 (file)
@@ -342,9 +342,6 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
 
     rc = guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0);
 
-    if ( !rc && test_and_clear_bit(_PGT_pinned, &page->u.inuse.type_info) )
-        put_page_and_type(page);
-
     /*
      * With the lack of an IOMMU on some platforms, domains with DMA-capable
      * device must retrieve the same pfn when the hypercall populate_physmap