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

[Xen-changelog] [xen stable-4.4] passthrough/amd: avoid reading an uninitialized variable



commit f38be14c6a6780bd6f67da5e0866690eaca2c491
Author:     Tim Deegan <tim@xxxxxxx>
AuthorDate: Mon Jul 13 14:02:00 2015 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Jul 13 14:02:00 2015 +0200

    passthrough/amd: avoid reading an uninitialized variable
    
    update_intremap_entry_from_msi() doesn't write to its data pointer on
    some error paths, so we copying that variable into the msg would count
    as undefined behaviour.
    
    Signed-off-by: Tim Deegan <tim@xxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@xxxxxxx>
    master commit: a8ccf2d9f6f291f8fc6003e3d8bc7275ac1cc69f
    master date: 2015-04-24 12:04:57 +0200
---
 xen/drivers/passthrough/amd/iommu_intr.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_intr.c 
b/xen/drivers/passthrough/amd/iommu_intr.c
index 18d8b5f..d3f3725 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -531,10 +531,12 @@ int amd_iommu_msi_msg_update_ire(
     } while ( PCI_SLOT(bdf) == PCI_SLOT(pdev->devfn) );
 
     if ( !rc )
+    {
         for ( i = 1; i < nr; ++i )
             msi_desc[i].remap_index = msi_desc->remap_index + i;
+        msg->data = data;
+    }
 
-    msg->data = data;
     return rc;
 }
 
--
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®.