[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <67d8f0f1-0846-876d-d36a-c8a9f9366243@citrix.com>
Date: Mon, 5 Feb 2018 15:14:29 +0000
From: Andrew Cooper <andrew.cooper3@...rix.com>
To: Arnd Bergmann <arnd@...db.de>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Juergen Gross <jgross@...e.com>
CC: <xen-devel@...ts.xenproject.org>,
David Laight <David.Laight@...lab.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [Xen-devel] [PATCH] [v2] xen: hypercall: fix out-of-bounds memcpy
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().
~Andrew
Powered by blists - more mailing lists