diff options
| author | Dave Airlie <airlied@redhat.com> | 2018-05-15 13:38:15 +1000 |
|---|---|---|
| committer | Ben Hutchings <ben@decadent.org.uk> | 2018-10-21 08:46:08 +0100 |
| commit | 54c959e5279eb678db8c977740fe830258c72387 (patch) | |
| tree | b2d663f0885a574a2b3e7e65e6a7bdcb67d7fdff /drivers/gpu | |
| parent | 72d8a061cbfbee3a357d38ef80688df9e878de43 (diff) | |
| download | linux-54c959e5279eb678db8c977740fe830258c72387.tar.gz linux-54c959e5279eb678db8c977740fe830258c72387.tar.bz2 linux-54c959e5279eb678db8c977740fe830258c72387.zip | |
drm: set FMODE_UNSIGNED_OFFSET for drm files
commit 76ef6b28ea4f81c3d511866a9b31392caa833126 upstream.
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>
[bwh: Backported to 3.16: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/gpu')
| -rw-r--r-- | drivers/gpu/drm/drm_fops.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 394bdc6617c7..45e85609fd7e 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c @@ -251,6 +251,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->uid = current_euid(); priv->pid = get_pid(task_pid(current)); |
