]> xenbits.xensource.com Git - xen.git/commitdiff
memory: don't implicitly unpin for decrease-reservation
authorJan Beulich <jbeulich@suse.com>
Tue, 27 Feb 2018 13:31:30 +0000 (14:31 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 27 Feb 2018 13:31:30 +0000 (14:31 +0100)
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>
master commit: d798a0952903db9d8ee0a580e03f214d2b49b7d7
master date: 2018-02-27 14:03:27 +0100

xen/common/memory.c

index c0c691a98a83b0204e75cf842ba0c08d726888b3..18ce62a7053f87197580561b3e99d2e8d3f3b29b 100644 (file)
@@ -320,9 +320,6 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
 
     rc = guest_physmap_remove_page(d, 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