WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-3.4-testing] x86-32/pod: fix map_domain_page() leak

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.4-testing] x86-32/pod: fix map_domain_page() leak
From: "Xen patchbot-3.4-testing" <patchbot-3.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 11 Dec 2009 01:11:07 -0800
Delivery-date: Fri, 11 Dec 2009 01:18:31 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1260522346 0
# Node ID 2cf845e9086c62efc5eb525531fc5777c1e4da9b
# Parent  763ce108c23631e708db89dd6a1a399963eeb145
x86-32/pod: fix map_domain_page() leak

The 'continue' in the if() part of the conditional at the end of
p2m_pod_zero_check() was causing this, but there also really is no
point in retaining the mapping after having checked page contents,
so fix it both ways. Additionally there is no point in updating
map[] at this point anymore.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
xen-unstable changeset:   20605:8f304c003af4
xen-unstable date:        Wed Dec 09 10:59:31 2009 +0000
---
 xen/arch/x86/mm/p2m.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff -r 763ce108c236 -r 2cf845e9086c xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Mon Dec 07 10:32:55 2009 +0000
+++ b/xen/arch/x86/mm/p2m.c     Fri Dec 11 09:05:46 2009 +0000
@@ -888,12 +888,13 @@ p2m_pod_zero_check(struct domain *d, uns
             if( *(map[i]+j) != 0 )
                 break;
 
+        unmap_domain_page(map[i]);
+
         /* See comment in p2m_pod_zero_check_superpage() re gnttab
          * check timing.  */
         if ( j < PAGE_SIZE/sizeof(*map[i]) )
         {
             set_p2m_entry(d, gfns[i], mfns[i], 0, types[i]);
-            continue;
         }
         else
         {
@@ -901,9 +902,6 @@ p2m_pod_zero_check(struct domain *d, uns
             p2m_pod_cache_add(d, mfn_to_page(mfns[i]), 0);
             d->arch.p2m->pod.entry_count++;
         }
-
-        unmap_domain_page(map[i]);
-        map[i] = NULL;
     }
     
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.4-testing] x86-32/pod: fix map_domain_page() leak, Xen patchbot-3.4-testing <=