From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Tim Deegan <tim@xen.org>, Sander Eikelenboom <linux@eikelenboom.it>
Cc: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
xen-devel@lists.xen.org
Subject: Re: [PATCH] passthrough/amd: avoid reading an uninitialized variable.
Date: Thu, 16 Apr 2015 14:49:43 -0400 [thread overview]
Message-ID: <20150416184942.GF7388@x230.dumpdata.com> (raw)
In-Reply-To: <1429202650-2608-1-git-send-email-tim@xen.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 <tim@xen.org>
> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> Cc: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
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
next prev parent reply other threads:[~2015-04-16 18:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-16 16:44 [PATCH] passthrough/amd: avoid reading an uninitialized variable Tim Deegan
2015-04-16 17:19 ` Andrew Cooper
2015-04-17 8:01 ` Jan Beulich
2015-04-16 18:49 ` Konrad Rzeszutek Wilk [this message]
2015-04-23 9:25 ` Tim Deegan
2015-04-23 22:16 ` Suthikulpanit, Suravee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150416184942.GF7388@x230.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=Aravind.Gopalakrishnan@amd.com \
--cc=linux@eikelenboom.it \
--cc=suravee.suthikulpanit@amd.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.