Skip to content

Commit 8655f28

Browse files
airliedgregkh
authored andcommitted
drm: set FMODE_UNSIGNED_OFFSET for drm files
commit 76ef6b2 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: be83bbf (mmap: introduce sane default mmap limits) Signed-off-by: Dave Airlie <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1ec1dfb commit 8655f28

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/drm_fops.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor)
198198
return -ENOMEM;
199199

200200
filp->private_data = priv;
201+
filp->f_mode |= FMODE_UNSIGNED_OFFSET;
201202
priv->filp = filp;
202203
priv->pid = get_pid(task_pid(current));
203204
priv->minor = minor;

0 commit comments

Comments
 (0)