]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm: set FMODE_UNSIGNED_OFFSET for drm files
authorDave Airlie <airlied@redhat.com>
Tue, 15 May 2018 03:38:15 +0000 (13:38 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 15 May 2018 04:46:04 +0000 (14:46 +1000)
Since we have the ttm and gem vma managers using a subset
of the file address space for objects, and these start at
0x100000000 they will overflow the new mmap checks.

I've checked all the mmap routines I could see for any
bad behaviour but overall most people use GEM/TTM VMA
managers even the legacy drivers have a hashtable.

Reported-and-Tested-by: Arthur Marsh (amarsh04 on #radeon)
Fixes: be83bbf8068 (mmap: introduce sane default mmap limits)
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_file.c

index e394799979a6eabce5c91a7a6b87773dd4b45186..6d9b9453707c5af4cbad984c790ce9538daa5d82 100644 (file)
@@ -212,6 +212,7 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor)
                return -ENOMEM;
 
        filp->private_data = priv;
+       filp->f_mode |= FMODE_UNSIGNED_OFFSET;
        priv->filp = filp;
        priv->pid = get_pid(task_pid(current));
        priv->minor = minor;