Skip to content

RFC DRM Render Nodes

Kristian Høgsberg dri-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3drm: Fix DRM_MINOR limits for control and render nodesdrivers/gpu/drm/drm_stub.c+2 -21 reply
2/3drm: Add support for render nodesdrivers/gpu/drm/drm_drv.c drivers/gpu/drm/drm_fops.c drivers/gpu/drm/drm_pci.c +1 more+25 -90 replies
3/3drm/i915: Support render nodesdrivers/gpu/drm/i915/i915_dma.c drivers/gpu/drm/i915/i915_drv.c+20 -190 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] [RFC] DRM Render Nodes

Here's the patch to implement render nodes as discussed in the "DRM2" talk at XDC:

http://wiki.x.org/wiki/Events/XDC2012/Proceedings#DRM2

The core problem is that DRM security is compromised in the face of VT switching and multiple DRM masters. Any local user can access all shared buffers from within any X server on the system, even when that user doesn't have access to any of those X servers.

The fix for this is to use dmabuf/prime and fd passing for buffer sharing. That infrastructure is already in place and we need to start using that in user space. Once we're passing buffers between display servers and clients in a point-to-point fashion, we no longer need to authenticate clients. We just need to make sure they can only render and import/export buffers to fds. That's what this patch does, by creating a new type of drm device node. Accessing this node doesn't require authentication (and as such can be used without a master, ie headless), but will only expose the safe, modern (DRI2ish) rendering ioctls.

Once userspace is sharing buffers through fd passing, the legacy card0 node can be locked down by unix permissions, for example in a drm-master group, so that only setgid binaries (X, weston, other KMS apps) can access it.

Kristian

See also:

http://wiki.x.org/wiki/Events/XDC2012/Proceedings#Graphics_stack_security

https://lwn.net/Articles/517375/