[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190116132141.GX10517@phenom.ffwll.local>
Date: Wed, 16 Jan 2019 14:21:41 +0100
From: Daniel Vetter <daniel@...ll.ch>
To: Gerd Hoffmann <kraxel@...hat.com>
Cc: Frediano Ziglio <fziglio@...hat.com>,
dri-devel@...ts.freedesktop.org, David Airlie <airlied@...ux.ie>,
open list <linux-kernel@...r.kernel.org>,
"open list:DRM DRIVER FOR QXL VIRTUAL GPU"
<virtualization@...ts.linux-foundation.org>,
Daniel Vetter <daniel@...ll.ch>,
"open list:DRM DRIVER FOR QXL VIRTUAL GPU"
<spice-devel@...ts.freedesktop.org>,
Dave Airlie <airlied@...hat.com>
Subject: Re: [Spice-devel] [PATCH 1/3] drm/qxl: add mode/framebuffer check
functions
On Wed, Jan 16, 2019 at 12:28:00PM +0100, Gerd Hoffmann wrote:
> > > +static int qxl_check_mode(struct qxl_device *qdev,
> > > + unsigned int width,
> > > + unsigned int height)
> > > +{
> > > + if (width * height * 4 > qdev->vram_size)
> >
> > Is someone checking for integer overflows already?
>
> Need to have a look. This is just ...
The addfb ioctl checks for integer overflows for you.
-Daniel
>
> > > - if (bo->surf.stride * bo->surf.height > qdev->vram_size) {
> > > - DRM_ERROR("Mode doesn't fit in vram size (vgamem)");
> > > - return -EINVAL;
> > > - }
>
> ... that check moved into the new function.
>
> cheers,
> Gerd
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Powered by blists - more mailing lists