[PATCH v3 02/23] drm: remove drm_vblank_no_hw_counter assignment from driver code

Thierry Reding thierry.reding at gmail.com
Tue Feb 7 11:01:41 UTC 2017


On Tue, Feb 07, 2017 at 10:44:49AM +0000, Russell King - ARM Linux wrote:
> On Tue, Feb 07, 2017 at 12:42:15PM +0200, Laurent Pinchart wrote:
> > On an unrelated note, for security reasons we should try to make the driver 
> > structure static, or at least move ops to a static structure.
> 
> ITYM "const" not "static".
> 
> "static" doesn't get you anything from a security point of view.  "const"
> gets you write protection, so code can't modify the function pointers.

We can't easily do that for struct drm_driver at the moment because some
fields end up being modified at runtime. I suppose we could move some of
those fields over to struct drm_device, which, in many cases, would make
more sense anyway.

What i915 is currently doing is probably fine for all existing cases,
but it sets a bad example for other drivers that may end up having to
drive multiple devices with one driver, so modifying the global driver
is likely going to break things.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20170207/4106e7a2/attachment.sig>


More information about the dri-devel mailing list