[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230815123817.GC3235352@fedora>
Date: Tue, 15 Aug 2023 08:38:17 -0400
From: Stefan Hajnoczi <stefanha@...hat.com>
To: Jason Gunthorpe <jgg@...pe.ca>
Cc: kvm@...r.kernel.org, "Tian, Kevin" <kevin.tian@...el.com>,
linux-kernel@...r.kernel.org,
Alex Williamson <alex.williamson@...hat.com>
Subject: Re: [PATCH 2/4] vfio: use __aligned_u64 in struct
vfio_device_gfx_plane_info
On Mon, Aug 14, 2023 at 02:50:40PM -0300, Jason Gunthorpe wrote:
> On Wed, Aug 09, 2023 at 05:02:46PM -0400, Stefan Hajnoczi wrote:
> > diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
> > index de675d799c7d..ffab3536dc8a 100644
> > --- a/drivers/gpu/drm/i915/gvt/kvmgt.c
> > +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
> > @@ -1382,7 +1382,7 @@ static long intel_vgpu_ioctl(struct vfio_device *vfio_dev, unsigned int cmd,
> > intel_gvt_reset_vgpu(vgpu);
> > return 0;
> > } else if (cmd == VFIO_DEVICE_QUERY_GFX_PLANE) {
> > - struct vfio_device_gfx_plane_info dmabuf;
> > + struct vfio_device_gfx_plane_info dmabuf = {};
> > int ret = 0;
> >
> > minsz = offsetofend(struct vfio_device_gfx_plane_info,
> > @@ -1392,6 +1392,8 @@ static long intel_vgpu_ioctl(struct vfio_device *vfio_dev, unsigned int cmd,
> > if (dmabuf.argsz < minsz)
> > return -EINVAL;
> >
> > + minsz = min(minsz, sizeof(dmabuf));
> > +
>
> Huh?
>
> minsz = min(sizeof(dmabuf), dmabuf.argsz)
Thanks for catching this. I will fix it in the next revision.
Stefan
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists