[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <81e2238e-3ed8-44dc-82fe-256155c271ba@moroto.mountain>
Date: Wed, 28 Feb 2024 20:42:52 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: Cindy Lu <lulu@...hat.com>, Jason Wang <jasowang@...hat.com>,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Xie Yongji <xieyongji@...edance.com>,
Maxime Coquelin <maxime.coquelin@...hat.com>,
Christian Brauner <brauner@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
virtualization@...ts.linux.dev, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] vduse: Fix off by one in vduse_dev_mmap()
On Tue, Feb 27, 2024 at 10:48:49AM -0500, Michael S. Tsirkin wrote:
> On Tue, Feb 27, 2024 at 06:21:46PM +0300, Dan Carpenter wrote:
> > The dev->vqs[] array has "dev->vq_num" elements. It's allocated in
> > vduse_dev_init_vqs(). Thus, this > comparison needs to be >= to avoid
> > reading one element beyond the end of the array.
> >
> > Fixes: 316ecd1346b0 ("vduse: Add file operation for mmap")
> > Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
>
>
> Oh wow and does this not come from userspace? If yes we
> need the speculation magic macro when using the index, do we not?
>
Yes, it does come from userspace.
To be honest, I'm not sure about speculation. The similar places in
this file protect against speculation so, probably? I'll resend the
patch.
regards,
dan carpenter
Powered by blists - more mailing lists