[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC PATCH 58/84] x86/mm: fix leaks in map_xen_pagetable.

On 26/09/2019 14:16, Wei Liu wrote:
On Thu, Sep 26, 2019 at 10:46:21AM +0100, hongyax@xxxxxxxxxx wrote:

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b2b2edbed1..145c5ab47c 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5160,6 +5160,7 @@ int map_pages_to_xen(
                               !(l2e_get_flags(ol2e) & _PAGE_PSE) )
+                    UNMAP_XEN_PAGETABLE(l2t);

This is presumably the issue you try to fix.

Yes. Actually this patch fixes two issues, this is the first one.

diff --git a/xen/common/vmap.c b/xen/common/vmap.c
index faebc1ddf1..fcdb8495c8 100644
--- a/xen/common/vmap.c
+++ b/xen/common/vmap.c

I fail to see why you need to change vmap to fix a leak somewhere else.

The second leak is that after the patches, we cannot just call vmap_to_mfn() because it calls virt_to_xen_l1e() under the hood which maps a page. We have to unmap it, therefore I modified the vmap_to_mfn to also do the unmapping. This is a separate issue than the first one, so maybe I could split the patch into two.

I guess I will need to wait for your branch to have a closer look.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.