fix authentication bug in linux and bsd mmap.

This commit is contained in:
Alan Hourihane 2001-05-23 21:08:27 +00:00
parent df9c7d4f8f
commit 61d7f8b1f7
4 changed files with 8 additions and 0 deletions

View file

@ -26,6 +26,8 @@ int DRM(mmap)(dev_t kdev, vm_offset_t offset, int prot)
/* DRM_DEBUG("offset = 0x%x\n", offset);*/
if (!priv->authenticated) DRM_OS_RETURN(EACCES);
if (dev->dma
&& offset >= 0
&& offset < ptoa(dev->dma->page_count))

View file

@ -26,6 +26,8 @@ int DRM(mmap)(dev_t kdev, vm_offset_t offset, int prot)
/* DRM_DEBUG("offset = 0x%x\n", offset);*/
if (!priv->authenticated) DRM_OS_RETURN(EACCES);
if (dev->dma
&& offset >= 0
&& offset < ptoa(dev->dma->page_count))

View file

@ -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 ) DRM_OS_RETURN(EACCES);
if (!VM_OFFSET(vma)) return DRM(mmap_dma)(filp, vma);
/* A sequential search of a linked list is

View file

@ -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 ) DRM_OS_RETURN(EACCES);
if (!VM_OFFSET(vma)) return DRM(mmap_dma)(filp, vma);
/* A sequential search of a linked list is