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

[Xen-changelog] [xen stable-4.4] xen/arm: domain_vgic_init: Avoid double free on shared_irqs



commit c3ed5de85e7916d70ac8f1e741d5fe31c719004c
Author:     Julien Grall <julien.grall@xxxxxxxxxx>
AuthorDate: Fri Jul 25 15:17:26 2014 +0100
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Wed Dec 10 12:06:35 2014 +0000

    xen/arm: domain_vgic_init: Avoid double free on shared_irqs
    
    When the function domain_vgic_init is failing to initialize pending_irqs,
    it will free shared_irqs. Few call later, domain_vgic_free will be called
    an try to free a second time the same variable. This will result to a double
    free.
    
    Remove the free in domain_vgic_init and rely on domain_vgic_free to 
correctly
    release the memory.
    
    Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    (cherry picked from commit 7b41618f5a08145b0198af4a8a2ce361d7e677e6)
---
 xen/arch/arm/vgic.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 850006c..86d4575 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -95,10 +95,7 @@ int domain_vgic_init(struct domain *d)
     d->arch.vgic.pending_irqs =
         xzalloc_array(struct pending_irq, d->arch.vgic.nr_lines);
     if ( d->arch.vgic.pending_irqs == NULL )
-    {
-        xfree(d->arch.vgic.shared_irqs);
         return -ENOMEM;
-    }
 
     for (i=0; i<d->arch.vgic.nr_lines; i++)
     {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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


 


Rackspace

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