mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-03 07:58:01 +02:00
do allow reading from read only mappings...
This commit is contained in:
parent
e5d3c7f260
commit
b942999b59
2 changed files with 2 additions and 2 deletions
|
|
@ -416,7 +416,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
|
|||
if (map->size != vma->vm_end - vma->vm_start) return -EINVAL;
|
||||
|
||||
if (!capable(CAP_SYS_ADMIN) && (map->flags & _DRM_READ_ONLY)) {
|
||||
vma->vm_flags &= VM_MAYWRITE;
|
||||
vma->vm_flags &= (VM_READ | VM_MAYREAD);
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -416,7 +416,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
|
|||
if (map->size != vma->vm_end - vma->vm_start) return -EINVAL;
|
||||
|
||||
if (!capable(CAP_SYS_ADMIN) && (map->flags & _DRM_READ_ONLY)) {
|
||||
vma->vm_flags &= VM_MAYWRITE;
|
||||
vma->vm_flags &= (VM_READ | VM_MAYREAD);
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue