aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_fops.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-10-29 04:55:57 -0400
committerDave Airlie <airlied@redhat.com>2013-11-05 23:27:35 -0500
commit1020dc6990168a5081ffad620c440e220f05b460 (patch)
tree3ed2fdb330463f2d23d08e6e8b10f4e1ba04d4cf /drivers/gpu/drm/drm_fops.c
parent33e3fd5567a8e04154f2a4b8978fb0f65f25224d (diff)
drm: Do not drop root privileges for a fancier younger process
When a second process opens the device and master transferrence is complete, we walk the list of open devices and remove their authentication. This also revokes our root privilege. Instead of simply dropping the authentication, this patch reverts the authenticated state back to its original value. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_fops.c')
-rw-r--r--drivers/gpu/drm/drm_fops.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
index ee2d330a2fa0..3a7176ce2540 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
@@ -239,7 +239,8 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
239 239
240 priv->ioctl_count = 0; 240 priv->ioctl_count = 0;
241 /* for compatibility root is always authenticated */ 241 /* for compatibility root is always authenticated */
242 priv->authenticated = capable(CAP_SYS_ADMIN); 242 priv->always_authenticated = capable(CAP_SYS_ADMIN);
243 priv->authenticated = priv->always_authenticated;
243 priv->lock_count = 0; 244 priv->lock_count = 0;
244 245
245 INIT_LIST_HEAD(&priv->lhead); 246 INIT_LIST_HEAD(&priv->lhead);
@@ -533,7 +534,7 @@ int drm_release(struct inode *inode, struct file *filp)
533 list_for_each_entry(temp, &dev->filelist, lhead) { 534 list_for_each_entry(temp, &dev->filelist, lhead) {
534 if ((temp->master == file_priv->master) && 535 if ((temp->master == file_priv->master) &&
535 (temp != file_priv)) 536 (temp != file_priv))
536 temp->authenticated = 0; 537 temp->authenticated = temp->always_authenticated;
537 } 538 }
538 539
539 /** 540 /**