From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alexander Graf <agraf@suse.de>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH] spapr-vscsi: Adding VSCSI capabilities
Date: Mon, 26 Aug 2013 08:10:37 +1000 [thread overview]
Message-ID: <1377468637.3819.27.camel@pasglop> (raw)
In-Reply-To: <24C2B209-2082-4AF8-A8FB-1FF8A8B7751B@suse.de>
On Sun, 2013-08-25 at 17:41 +0100, Alexander Graf wrote:
> > + vcap = &req->iu.mad.capabilities;
> > + rc = spapr_vio_dma_read(&s->vdev, be64_to_cpu(vcap->buffer),
> > + &cap,
> be16_to_cpu(vcap->common.length));
>
> While I don't think any harm could happen from it, this could lead to
> a potential timing attack where we read and write from different
> locations in memory if the guest swizzles the request while we're
> processing it.
BTW. While I disagree with your initial comment ... is there any bound
checking here ? That looks like potential stack corruption unless I
miss something if the guest passes a too big length...
So at least the length should be read once, bound-checked, then the read
done with the result (don't bound check and read again, that would be
indeed racy).
Cheers,
Ben.
next prev parent reply other threads:[~2013-08-25 22:11 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-23 9:22 [Qemu-devel] [PATCH] spapr-vscsi: Adding VSCSI capabilities Alexey Kardashevskiy
2013-08-25 16:41 ` Alexander Graf
2013-08-25 20:51 ` Benjamin Herrenschmidt
2013-08-26 13:37 ` Paolo Bonzini
2013-08-27 0:45 ` Benjamin Herrenschmidt
2013-08-25 22:10 ` Benjamin Herrenschmidt [this message]
2013-08-26 4:32 ` Nikunj A Dadhania
2013-08-26 5:44 ` Alexander Graf
2013-08-26 6:22 ` Benjamin Herrenschmidt
2013-08-26 8:43 ` Alexander Graf
2013-08-26 9:08 ` Nikunj A Dadhania
2013-08-26 9:52 ` Alexander Graf
2013-08-26 10:03 ` Benjamin Herrenschmidt
2013-08-26 10:47 ` Nikunj A Dadhania
2013-08-26 10:58 ` Nikunj A Dadhania
2013-08-26 11:17 ` Alexander Graf
2013-08-26 11:46 ` Nikunj A Dadhania
2013-08-26 11:49 ` Alexander Graf
2013-08-27 5:14 ` Nikunj A Dadhania
2013-08-27 5:43 ` Nikunj A Dadhania
2013-08-27 8:45 ` Alexander Graf
2013-08-27 9:27 ` Nikunj A Dadhania
2013-08-26 6:19 ` Benjamin Herrenschmidt
2013-08-26 9:06 ` Nikunj A Dadhania
2013-08-26 13:42 ` Paolo Bonzini
2013-08-27 5:11 ` Nikunj A Dadhania
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=1377468637.3819.27.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=nikunj@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).