drm: add control node checks missing from kms merge

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Tuesday, May 5, 2009 - 8:59 pm

Gitweb:     http://git.kernel.org/linus/59738d5c974d81b566cb53c203f5db268b7b3545
Commit:     59738d5c974d81b566cb53c203f5db268b7b3545
Parent:     c964b129425c98cb37da365e772bdbe5281f3a05
Author:     Jonas Bonn <jonas@southpole.se>
AuthorDate: Fri Apr 24 15:05:02 2009 +1000
Committer:  Dave Airlie <airlied@redhat.com>
CommitDate: Fri Apr 24 15:05:02 2009 +1000

    drm: add control node checks missing from kms merge
    
    This line that checks the DRM_CONTROL_ALLOW flag was missed from the KMS
    merge.  Re-add the check on the IOCTL, as this is currently the only use of
    this flag.
    
    Signed-off-by: Jonas Bonn <jonas@southpole.se>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/drm_drv.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index c4ada8b..f01def1 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -456,7 +456,8 @@ int drm_ioctl(struct inode *inode, struct file *filp,
 		retcode = -EINVAL;
 	} else if (((ioctl->flags & DRM_ROOT_ONLY) && !capable(CAP_SYS_ADMIN)) ||
 		   ((ioctl->flags & DRM_AUTH) && !file_priv->authenticated) ||
-		   ((ioctl->flags & DRM_MASTER) && !file_priv->is_master)) {
+		   ((ioctl->flags & DRM_MASTER) && !file_priv->is_master) ||
+		   (!(ioctl->flags & DRM_CONTROL_ALLOW) && (file_priv->minor->type == DRM_MINOR_CONTROL))) {
 		retcode = -EACCES;
 	} else {
 		if (cmd & (IOC_IN | IOC_OUT)) {
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
drm: add control node checks missing from kms merge, Linux Kernel Mailing ..., (Tue May 5, 8:59 pm)