From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH] passthrough/amd: avoid reading an uninitialized variable. Date: Thu, 16 Apr 2015 14:49:43 -0400 Message-ID: <20150416184942.GF7388@x230.dumpdata.com> References: <1429202650-2608-1-git-send-email-tim@xen.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1429202650-2608-1-git-send-email-tim@xen.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan , Sander Eikelenboom Cc: Aravind Gopalakrishnan , Suravee Suthikulpanit , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, Apr 16, 2015 at 05:44:10PM +0100, Tim Deegan wrote: > 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 > Cc: Suravee Suthikulpanit > Cc: Aravind Gopalakrishnan CC-ing Sander who I believe saw this problem. http://lists.xen.org/archives/html/xen-devel/2015-03/msg03679.html > --- > I'm not sure whether we ought to be writing some default value > instead. Happy to respin if someone knowledgeable can advise. > --- > xen/drivers/passthrough/amd/iommu_intr.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c > index c1b76fb..c097d52 100644 > --- a/xen/drivers/passthrough/amd/iommu_intr.c > +++ b/xen/drivers/passthrough/amd/iommu_intr.c > @@ -529,10 +529,11 @@ 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; > } > > -- > 2.1.4 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel