mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 06:32:08 +00:00
IB/ipath: drop requirement that PIO buffers be mmaped write-only
Some userlands try to mmap these pages read-write, so accommodate them. Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
parent
ba11203a11
commit
367fe711c5
1 changed files with 4 additions and 9 deletions
|
@ -992,15 +992,10 @@ static int mmap_piobufs(struct vm_area_struct *vma,
|
||||||
pgprot_val(vma->vm_page_prot) &= ~_PAGE_GUARDED;
|
pgprot_val(vma->vm_page_prot) &= ~_PAGE_GUARDED;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (vma->vm_flags & VM_READ) {
|
/*
|
||||||
dev_info(&dd->pcidev->dev,
|
* don't allow them to later change to readable with mprotect (for when
|
||||||
"Can't map piobufs as readable (flags=%lx)\n",
|
* not initially mapped readable, as is normally the case)
|
||||||
vma->vm_flags);
|
*/
|
||||||
ret = -EPERM;
|
|
||||||
goto bail;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* don't allow them to later change to readable with mprotect */
|
|
||||||
vma->vm_flags &= ~VM_MAYREAD;
|
vma->vm_flags &= ~VM_MAYREAD;
|
||||||
vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND;
|
vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue