diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2015-12-02 18:24:46 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-12-04 03:28:14 +0100 |
commit | a0af2e538c80f3e47f1d6ddf120a153ad909e8ad (patch) | |
tree | 056678eb2ff49c0d8e489f34995d7089e5b134bb /include | |
parent | Merge tag 'imx-drm-fixes-2015-12-01' of git://git.pengutronix.de/git/pza/linu... (diff) | |
download | linux-a0af2e538c80f3e47f1d6ddf120a153ad909e8ad.tar.xz 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 'include')
-rw-r--r-- | include/drm/drmP.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 0b921ae06cd8..441b26e846d8 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -309,6 +309,11 @@ struct drm_file { unsigned universal_planes:1; /* true if client understands atomic properties */ unsigned atomic:1; + /* + * This client is allowed to gain master privileges for @master. + * Protected by struct drm_device::master_mutex. + */ + unsigned allowed_master:1; struct pid *pid; kuid_t uid; @@ -910,6 +915,7 @@ extern int drm_open(struct inode *inode, struct file *filp); extern ssize_t drm_read(struct file *filp, char __user *buffer, size_t count, loff_t *offset); extern int drm_release(struct inode *inode, struct file *filp); +extern int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv); /* Mapping support (drm_vm.h) */ extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); |