[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <67af4fbe-9dc1-45f7-aef2-ed397da733ef@moroto.mountain>
Date: Wed, 28 Feb 2024 21:16:02 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Stefan Hajnoczi <stefanha@...il.com>
Cc: Cindy Lu <lulu@...hat.com>, "Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Xie Yongji <xieyongji@...edance.com>,
Maxime Coquelin <maxime.coquelin@...hat.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Christian Brauner <brauner@...nel.org>,
virtualization@...ts.linux.dev, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH v2] vduse: Fix off by one in vduse_dev_mmap()
On Wed, Feb 28, 2024 at 12:53:28PM -0500, Stefan Hajnoczi wrote:
> On Wed, 28 Feb 2024 at 12:44, Dan Carpenter <dan.carpenter@...aro.org> 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.
> >
> > Add an array_index_nospec() as well to prevent speculation issues.
> >
> > Fixes: 316ecd1346b0 ("vduse: Add file operation for mmap")
> > Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> > ---
> > v2: add array_index_nospec().
>
> Did you forget to update the patch, I don't see array_index_nospec()?
>
> >
> > drivers/vdpa/vdpa_user/vduse_dev.c | 3 ++-
^^^^^
I updated the patch but the thing about vim is that every time you
press a button it does something unexpected. Vim ate my homework.
regards,
dan carpenter
Powered by blists - more mailing lists