[PATCH 07/16] drm: only allow render node ioctls through control node
Ilija Hadzic
ihadzic at research.bell-labs.com
Thu Mar 29 09:41:29 PDT 2012
The render-node manipulation ioctls are supposed to be
issued through control node only. Add a check and return
-EPERM to user space if access is attempted through a
node other than a control node.
Signed-off-by: Ilija Hadzic <ihadzic at research.bell-labs.com>
---
drivers/gpu/drm/drm_stub.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index 12260f0..fb241e6 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -552,6 +552,10 @@ int drm_render_node_create_ioctl(struct drm_device *dev, void *data,
int total_ids, i;
uint32_t __user *ids_ptr;
+ /* allow access through control node only */
+ if (file_priv->minor != dev->control)
+ return -EPERM;
+
/* trivial case: render node with no display resources */
if (args->num_crtc == 0 &&
args->num_encoder == 0 &&
@@ -602,6 +606,10 @@ int drm_render_node_remove_ioctl(struct drm_device *dev, void *data,
struct drm_render_node_remove *args = data;
int ret;
+ /* allow access through control node only */
+ if (file_priv->minor != dev->control)
+ return -EPERM;
+
ret = drm_destroy_render_node(dev, args->node_minor_id);
return ret;
}
--
1.7.8.5
More information about the dri-devel
mailing list