Re: [PATCH] drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Daniel Vetter (2018-09-04 22:46:33)
> On Tue, Sep 04, 2018 at 09:53:19PM +0100, Chris Wilson wrote:
> > Since this is handling user provided bpp and depth, we need to sanity
> > check and propagate the EINVAL back rather than assume what the insane
> > client intended and fill the logs with DRM_ERROR.
> > 
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
> > Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> > ---
> > So I am presuming that r.pixel_format == 0 is rejected elsewhere for the
> > internal users (as if any would deliberately provoke the error)!
> 
> Could maybe add a DRM_FORMAT_INVALID at the end of drm_fourcc.h, and then
> switch over the various format/modifier tables to being zero terminated.
> Well DRM_FORMAT_MOD_INVALID can't be 0 because that means linear. Anyway,
> I digress, this loks good.
> 
> And yes drm_internal_framebuffer_create makes sure you have a real fourcc
> code, not a figment of your imagination (or more profane, stack garbage).
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
> 
> Same as with the previous one, igt would be sweet on top.

And the first thing one does with the test case is realise that we never
check that depth is valid for the bpp based pixel format.
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux