diff options
-rw-r--r-- | linux-core/drm_vm.c | 2 | ||||
-rw-r--r-- | linux/drm_vm.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c index 771c11bd2..d17a13707 100644 --- a/linux-core/drm_vm.c +++ b/linux-core/drm_vm.c @@ -377,6 +377,8 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) DRM_DEBUG("start = 0x%lx, end = 0x%lx, offset = 0x%lx\n", vma->vm_start, vma->vm_end, VM_OFFSET(vma)); + if ( !priv->authenticated ) return -EACCES; + if (!VM_OFFSET(vma)) return DRM(mmap_dma)(filp, vma); /* A sequential search of a linked list is diff --git a/linux/drm_vm.h b/linux/drm_vm.h index 771c11bd2..d17a13707 100644 --- a/linux/drm_vm.h +++ b/linux/drm_vm.h @@ -377,6 +377,8 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) DRM_DEBUG("start = 0x%lx, end = 0x%lx, offset = 0x%lx\n", vma->vm_start, vma->vm_end, VM_OFFSET(vma)); + if ( !priv->authenticated ) return -EACCES; + if (!VM_OFFSET(vma)) return DRM(mmap_dma)(filp, vma); /* A sequential search of a linked list is |