summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2015-12-02 09:24:46 -0800
committerLuis Henriques <luis.henriques@canonical.com>2016-01-05 12:08:21 +0000
commit7150da7c28e53aa1482596fedd494be3b48fb64d (patch)
tree6570fda30db10c7961a8b36540a2aa248fdcb80d /include
parent02d4d9512faf2e50dfc426e1970a3471d70243e1 (diff)
drm: Fix an unwanted master inheritance v2
commit a0af2e538c80f3e47f1d6ddf120a153ad909e8ad upstream. 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(). Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com> [ luis: backported to 3.16: - drm_setmaster_ioctl() in file drm_stub.c instead of drm_drv.c - adjusted context ] Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Diffstat (limited to 'include')
-rw-r--r--include/drm/drmP.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 8af71a8e2c00..6eec68c9b459 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -407,6 +407,11 @@ struct drm_file {
* in the plane list
*/
unsigned universal_planes: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;
@@ -1219,6 +1224,7 @@ extern int drm_stub_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 int drm_mmap(struct file *filp, struct vm_area_struct *vma);