Commit 12958d0f authored by Dave Airlie's avatar Dave Airlie Committed by Greg Kroah-Hartman

drm: set FMODE_UNSIGNED_OFFSET for drm files

commit 76ef6b28 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: be83bbf8 (mmap: introduce sane default mmap limits)
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 66824bdf
...@@ -209,6 +209,7 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor) ...@@ -209,6 +209,7 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor)
return -ENOMEM; return -ENOMEM;
filp->private_data = priv; filp->private_data = priv;
filp->f_mode |= FMODE_UNSIGNED_OFFSET;
priv->filp = filp; priv->filp = filp;
priv->uid = current_euid(); priv->uid = current_euid();
priv->pid = get_pid(task_pid(current)); priv->pid = get_pid(task_pid(current));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment