summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_drv.c
diff options
context:
space:
mode:
authorThomas Hellstrom2015-12-02 18:24:46 +0100
committerDave Airlie2015-12-04 03:28:14 +0100
commita0af2e538c80f3e47f1d6ddf120a153ad909e8ad (patch)
tree056678eb2ff49c0d8e489f34995d7089e5b134bb /drivers/gpu/drm/drm_drv.c
parentMerge tag 'imx-drm-fixes-2015-12-01' of git://git.pengutronix.de/git/pza/linu... (diff)
downloadkernel-qcow2-linux-a0af2e538c80f3e47f1d6ddf120a153ad909e8ad.tar.gz
kernel-qcow2-linux-a0af2e538c80f3e47f1d6ddf120a153ad909e8ad.tar.xz
kernel-qcow2-linux-a0af2e538c80f3e47f1d6ddf120a153ad909e8ad.zip
drm: Fix an unwanted master inheritance v2
A client calling drmSetMaster() using a file descriptor that was opened when another client was master would inherit the latter client's master object and all its authenticated clients. This is unwanted behaviour, and when this happens, instead allocate a brand new master object for the client calling drmSetMaster(). Fixes a BUG() throw in vmw_master_set(). Cc: <stable@vger.kernel.org> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r--drivers/gpu/drm/drm_drv.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 9362609df38a..7dd6728dd092 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -160,6 +160,11 @@ int drm_setmaster_ioctl(struct drm_device *dev, void *data,
goto out_unlock;
}
+ if (!file_priv->allowed_master) {
+ ret = drm_new_set_master(dev, file_priv);
+ goto out_unlock;
+ }
+
file_priv->minor->master = drm_master_get(file_priv->master);
file_priv->is_master = 1;
if (dev->driver->master_set) {