提交 e445ee65 编写于 作者: D David S. Miller

[VIDEO] sbuslib: Disallow private mmaps.

The COW semantics just do not make any sense especially
with the physically discontiguous I/O mappings possible
here.
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 597d1f06
...@@ -46,6 +46,9 @@ int sbusfb_mmap_helper(struct sbus_mmap_map *map, ...@@ -46,6 +46,9 @@ int sbusfb_mmap_helper(struct sbus_mmap_map *map,
unsigned long off; unsigned long off;
int i; int i;
if (!(vma->vm_flags & (VM_SHARED | VM_MAYSHARE)))
return -EINVAL;
size = vma->vm_end - vma->vm_start; size = vma->vm_end - vma->vm_start;
if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
return -EINVAL; return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册