mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-07 11:08:05 +02:00
fix authentication bug in linux and bsd mmap.
This commit is contained in:
parent
df9c7d4f8f
commit
61d7f8b1f7
4 changed files with 8 additions and 0 deletions
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue