From: David Laight <David.Laight@ACULAB.COM>
To: "'Andrew Cooper'" <andrew.cooper3@citrix.com>,
Arnd Bergmann <arnd@arndb.de>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Juergen Gross <jgross@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
"Dan Carpenter" <dan.carpenter@oracle.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [Xen-devel] [PATCH] [v2] xen: hypercall: fix out-of-bounds memcpy
Date: Mon, 5 Feb 2018 15:28:23 +0000 [thread overview]
Message-ID: <0f6cfd45286247a3b69d46db1bc87fb5@AcuMS.aculab.com> (raw)
In-Reply-To: <67d8f0f1-0846-876d-d36a-c8a9f9366243@citrix.com>
From: Andrew Cooper
> Sent: 05 February 2018 15:14
>
> On 05/02/18 15:03, Arnd Bergmann wrote:
>
> Snipping deleted code to make things clearer:
>
> > + if (cmd > ARRAY_SIZE(physdevop_len))
> > + return -ENOSYS;
> >
> > + len = physdevop_len[cmd];
> > + memcpy(&op.u, arg, len);
>
> You'll want an array_nospec() or whatever its called these days. This
> code is SP1-leaky.
>
> Userspace controls cmd and can retrieve len by timing how many adjacent
> cache lines were pulled in my memcpy().
Well, maybe it can read beyond the bounds of physdevop_len[].
I doubt that the memcpy() will pull in many cache lines so you
can probably only determine whether the value is 0..63, 64..127 or 128+
Not likely to be much use.
David
next prev parent reply other threads:[~2018-02-05 15:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-05 15:03 Arnd Bergmann
2018-02-05 15:14 ` [Xen-devel] " Andrew Cooper
2018-02-05 15:28 ` David Laight [this message]
2018-02-09 12:57 ` Arnd Bergmann
2018-02-09 14:13 ` David Laight
2018-02-09 14:21 ` Arnd Bergmann
2018-02-09 16:20 ` Dan Williams
2018-02-05 15:14 ` Jan Beulich
2018-02-05 15:47 ` Arnd Bergmann
2018-02-05 15:51 ` Nicolas Pitre
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=0f6cfd45286247a3b69d46db1bc87fb5@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=andrew.cooper3@citrix.com \
--cc=arnd@arndb.de \
--cc=boris.ostrovsky@oracle.com \
--cc=dan.carpenter@oracle.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xenproject.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
all inboxes | Powered by JetHome®