summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGareth Hughes <gareth@users.sourceforge.net>2001-05-23 17:41:31 +0000
committerGareth Hughes <gareth@users.sourceforge.net>2001-05-23 17:41:31 +0000
commitdca245e37c875660fa766a264377628dd3a311e5 (patch)
tree97b5e4d2b7d2fe83dace76ce148f81af6dad1041
parent18ce40c9d31c166b49e6689c260eb1ddb3cc08c9 (diff)
Only authenticated clients can mmap() (Jeff Hartmann).
-rw-r--r--linux-core/drm_vm.c2
-rw-r--r--linux/drm_vm.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c
index 771c11bd..d17a1370 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 771c11bd..d17a1370 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