[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <5A7882EA02000078001A552D@prv-mh.provo.novell.com>
Date: Mon, 05 Feb 2018 08:14:34 -0700
From: "Jan Beulich" <JBeulich@...e.com>
To: "Arnd Bergmann" <arnd@...db.de>
Cc: "David Laight" <David.Laight@...lab.com>,
<xen-devel@...ts.xenproject.org>,
"Boris Ostrovsky" <boris.ostrovsky@...cle.com>,
"Dan Carpenter" <dan.carpenter@...cle.com>,
"Juergen Gross" <jgross@...e.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [Xen-devel] [PATCH] [v2] xen: hypercall: fix out-of-bounds
memcpy
>>> On 05.02.18 at 16:03, <arnd@...db.de> wrote:
> int xen_event_channel_op_compat(int cmd, void *arg)
> {
> - struct evtchn_op op;
> + struct evtchn_op op = { .cmd = cmd, };
> + size_t len;
> int rc;
>
> - op.cmd = cmd;
> - memcpy(&op.u, arg, sizeof(op.u));
> - rc = _hypercall1(int, event_channel_op_compat, &op);
> -
> - switch (cmd) {
> - case EVTCHNOP_close:
> - case EVTCHNOP_send:
> - case EVTCHNOP_bind_vcpu:
> - case EVTCHNOP_unmask:
> - /* no output */
> - break;
> + if (cmd > ARRAY_SIZE(evtchnop_len))
> + return -ENOSYS;
>= perhaps?
Jan
Powered by blists - more mailing lists