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-unstable] xc_domain_save: allocate pfn_err before u

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xc_domain_save: allocate pfn_err before use
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 19 Jan 2010 02:05:12 -0800
Delivery-date: Tue, 19 Jan 2010 02:05:21 -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 1263894030 0
# Node ID b684d9e57b8f80b2b782fd63859fb5d58c01ee16
# Parent  d7e8b6a66a3d3329e515a5f5cbf8f5d3ea43c199
xc_domain_save: allocate pfn_err before use

Due to recent changes related to xc_map_foreign_bulk, xc_domain_save
segfaults because it tries to use pfn_err without allocating it first.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 tools/libxc/xc_domain_save.c |    2 ++
 1 files changed, 2 insertions(+)

diff -r d7e8b6a66a3d -r b684d9e57b8f tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c      Mon Jan 18 14:49:00 2010 +0000
+++ b/tools/libxc/xc_domain_save.c      Tue Jan 19 09:40:30 2010 +0000
@@ -1273,6 +1273,7 @@ int xc_domain_save(int xc_handle, int io
             if ( batch == 0 )
                 goto skip; /* vanishingly unlikely... */
 
+            pfn_err = realloc(pfn_err, sizeof(int) * batch);
             region_base = xc_map_foreign_bulk(
                 xc_handle, dom, PROT_READ, pfn_type, pfn_err, batch);
             if ( region_base == NULL )
@@ -1832,6 +1833,7 @@ int xc_domain_save(int xc_handle, int io
 
     free(pfn_type);
     free(pfn_batch);
+    free(pfn_err);
     free(to_send);
     free(to_fix);
     free(to_skip);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xc_domain_save: allocate pfn_err before use, Xen patchbot-unstable <=